At 11:17 AM -0500 2002/06/18, John Nicholas wrote:
>OK, I didn't explain my problem very well . I have no problems with 
>saving the  graphic uploaded or displaying it later. I'm wondering 
>how to handle editing this same data later. My original form lets 
>the user add an entry to a database. Let's pretend it's an address 
>book with pictures so the form lets me put in name, address and 
>upload a jpeg. In the database I store the name, address and path to 
>the graphic. Later I want to be able to edit this data. I have the 
>form come up prepopulated with their name and address and those 
>fields can be changed and updated in the database.
>
>I'm wondering how the file upload field should be handled. Should I 
>put anything in it or leave it empty? If I leave it empty I could 
>replace the graphic only if they upload one and leave it as the 
>original if they don't. That might imply to the user that there 
>isn't a graphic when there is plus I'd have to validate the graphic 
>differently.
>
>Do users expect the name of the original graphic to be there and if 
>so how to get it in there without confusing the ActionForm? I 
>obviously wouldn't be sending the graphic back to them and having 
>them upload it again through the form the way you do with text in a 
>text field but I don't see how to only send the name of the graphic 
>and only maybe get a graphic back.

You can't "pre-fill" an upload form field.  No popular browsers have 
any support for the "value" attribute.  I was checking that in 
response to an earlier post on struts-user today.  Here's a link with 
more info 
<http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm> 
Just found that w/Google, so I'm not endorsing it.

If you have a form where the upload is optional, check the "fileSize" 
property of your formFile to see if someone gave you anything to 
handle or not.

Joe

-- 
--
* Joe Germuska    { [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
        --Sam Goody, 1956
tune in posse radio: <http://www.live365.com/stations/289268>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to