Re: FileUpload Component Query
Re: FileUpload Component Query
- Subject: Re: FileUpload Component Query
- From: "Jonathan Fleming" <email@hidden>
- Date: Mon, 13 Jan 2003 15:20:32 +0000
Hello Chuck,
Thanks for you help and advice so far. OK if I use some thing like:
protected String myFilePath;
public void setMyFilePath(String aFilePath) {
myFilePath = NSPathUtilities.lastPathComponent(aFilePath);
}
public String getMyFilePath() {
return myFilePath;
}
How would I then get this into the database if my EOCustomObject java file
fields are:
public NSData picThumbnail() {
return (NSData)storedValueForKey("picThumbnail");
}
public void setPicThumbnail(NSData value) {
takeStoredValueForKey(value, "picThumbnail");
}
public String picThumbRef() {
return (String)storedValueForKey("picThumbRef");
}
public void setPicThumbRef(String value) {
takeStoredValueForKey(value, "picThumbRef");
}
Can you send example code please, explaination sometimes baffle me, I learn
best by seeing the physical code
Kind regards
Jonathan
From: Chuck Hill <email@hidden>
To: Jonathan Fleming <email@hidden>
CC: email@hidden
Subject: Re: FileUpload Component Query
Date: Fri, 10 Jan 2003 15:31:40 -0800
Don't bind a WOFileUpload directly to the EO. Bind it to a String (path)
and NSData (file contents) in your component. Check if the path is
non-null. If it is then something was uploaded and you should update the
EO. Otherwise the user did not select a file.
Chuck
Jonathan Fleming wrote:
When using a fileUpload component in a form with other elements, I notice
that if I want to edit and update an object I have to choose the required
filePath everytime I do so because if I don't actually enter any data into
the fileupload element I find that on a save to the database I loose what
was originally there. In effect my save has uploaded an empy string.
When I go to edit an object all the other elements fill themselves
with the exsisting data from the database of that particular row except
the fileupload element which is always empty... how do I get around this
problem of having to enter the same data every time I want to update for
example a spelling mistake in a lastName field, but whish the rest of the
field to stay as they are including the fileUpload field which does not
actually show me what it has entered in it's field.
Kind regards
Jonathan
ps Advanced thanks in case I don't get back to you should you
provide the answer.
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Chuck Hill - Village Idiot email@hidden
Global Village Consulting Inc. http://www.global-village.net
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.