Hi all,

I have a multipart/form-data form to upload a binary file, along with a hidden attribute called "id":

  <html:form action="/piece/save"
           method="post"
           enctype="multipart/form-data">
    <html:hidden property="id" value="54"/>
    <html:file property="content"/>
  </html:form>

This works fine with most files I upload. However, several files consistently produce a null "id" value in the receiving Action when I try to upload them.

I found that these files always contained the string "id=":

   $ ls
   invalid-music.mp3  valid-music.mp3

   $ grep "id=" *
   Binary file invalid-music.mp3 matches

Maybe I should be URL-encoding the binary part of the form data somehow, so that the "=id" doesn't interfere with my hidden parameter of the same name.

Am I missing some existing way of doing this? I've checked the developer's guide, the API docs, and the list archives, to no avail.

I'm using Struts 1.1, running on Tomcat 4.1 on Debian Sarge.

Cheers,

-Joe


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



Reply via email to