Well, I think I need some more help here.

I removed one of my WOFileUploads, so now I have a form, with enctype set to "formdata/multi-part", that contains a WOTextField, a WOTextArea, and the one WOFileUpload.  And, of course, a Submit button.

If I bind the data attribute of the WOFileUpload directly to the corresponding attribute in my entity, I get no errors, but the BLOB column in the database remains null.   Same if I bind it to an intermediate variable of type NSData, then use that to set the value of the entity attribute.

I tried adding this line to my saveAction method in Add.java, to see if I was actually getting any data from the browser, but it causes a Null Pointer Exception:

NSLog.out.appendln("length of nsdata = " + uploadedThumbnail.length());

So I'm still stuck;  I don't know why I'm getting an NPE, and I don't know how to debug the upload problem.

I will go do some more Googling for other people's file upload problems, but any suggestions would be most appreciated!

janine

On Jul 21, 2006, at 11:38 PM, [EMAIL PROTECTED] wrote:

I'm building my first WO app (not counting the tutorial) and I'm stuck.  First time of many, I'm sure. :)

My goal is to duplicate this site:  http://www.nhlpm.org.  We put that together as a temporary site for a former neighbor, who has a license plate museum in his garage.  Right now it's static HTML, and the long-term goal is to build him a really snazzy site to showcase his collection.  But for now I just want to duplicate what's there, which means (disregarding the intro page) I need one display page and one set of add/edit/delete pages.

My entity is called Panel, and I made it through all the EOModeler/FrontBase stuff without too much trouble.  I decided to write the "add" page first, since I need to get something into the database before I can do anything else.  So first I wrote an add page that just handled the title and description, and life is good.  Data is making it's way into the database just fine.

Now I need to handle the thumbnail and full-sized images.  I knew this would be the hard part;  I've seen a number of people having trouble with WOFileUpload.  So I started out simple - no file type checking or anything, just get the data into the database.

The two attributes are called thumbnail and bigImage, and they are both BLOBs on the database side and NSData on the application side.

My first attempt was to put the two WOFileUploads into my form, and bind their data attributes directly to the corresponding entity attributes.  No errors, but no data being saved either.  I tried this first without the enctype set, then with it set to "multipart/form-data".  I also tried binding them to independent NSDatas as well, and then using those to set the ones in the entity, but no luck.  My next step is to check the length of those NSDatas and see if the files are being uploaded at all, but it's late and that will have to wait.

Is there anything obvious I'm doing wrong here?  I thought I read a discussion of this not too long ago on one of the lists, but Google isn't finding it for me.

thanks,

janine

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

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to