• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Upload using O'Reilly package

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given this html form,
,
it seems that when I try to get the value of 'aText' in the servlet returns an empty String.
My question is:
is this behaviour normal? Once the enctype is multipart/form-data I cannot send some description of the file in the same request object?
Thank you,
Adrian
[ December 18, 2002: Message edited by: Adrian Muscalu ]
[ December 18, 2002: Message edited by: Adrian Muscalu ]
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
you have to ask the multipart if the next part is an file or a parameter. then you put the parameter in an hashtable (or work with it directly) and the file in an uploaddirectory or something else.

this is an example to upload the file in UPLOADDIR and put the parameter in a hashtable. the hashtable is the reuturn of this method.
i hope this helps
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your help,
the example works just fine. I've tried to save the FilePart object in the hashtable for future actions but it doesn't work. It is affected somehow and the uploaded file ends up with 0Kb.
Could this be a bug in O'Reilly's package?
Again, if I save the file into the while statement it works OK. However, it is not practical if you want to have a "conditional" upload, depending on the parameters retreieved from the same request object.
Thank you,
Adrian
 
reply
    Bookmark Topic Watch Topic
  • New Topic