• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WOFileUpload
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WOFileUpload


  • Subject: WOFileUpload
  • From: ".::welemski::." <email@hidden>
  • Date: Wed, 25 Jan 2006 15:09:52 +0800

Hi,

It's me again... "WebObjects NewBie".

I've been using WOFileUpload manytimes and the only attributes I'm familiar with are ff;

data
filepath
mimetype

A while ago i made an application just for file upload and so I created the ff variables bound to their respective attribute.

NSData fileData bound to data attrb
String filePathName bound to filePath attrib
String fileMimeType bound to mimeType attrib

Then I instanciated and entity to where my data is to be saved.

Entity myEntity=new Entity();

and in my action method i created these ff code

public WOComponent save(){
myEntity.setImageDate(fileData);
myEntity.setMimeType(fileMimeType);
myEntity.setPathName(filePathName);
myEntity.setOwner (strOwnerName);
ec.insertObject(myEntity);
ec.saveChanges();
}

I dunno if this is the correct way of saving a picture to database but i have a working application that uses this kind of method
and it works for me.

Although this works on my previous app this time it did not.
What happen is that only the "strOwnerName" is being saved in the database and not the picture that is bound into the
"WOFileUpload".
Then i found out after trying to debug the variable "fileData" returned something like this:

<class com.webobjects.foundation.NSData(empty...)>

How is possible?
Im sure I there's something wrong with my code i just don't have any idea. I have been
debugging for many hours but I can't find the problem.

WebObject Masters please help we with this....


--
 -- -- -- -- -- -- -- -- -- -- --
          welemski
 -- -- -- -- -- -- --
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: NSTimestamp
  • Next by Date: Re: WOWebServices question
  • Previous by thread: Re: NSTimestamp
  • Next by thread: WebObjects and Ajax: Is it time?
  • Index(es):
    • Date
    • Thread