Hello Steve,

you can implement a PartSource that returns 0 as the
content length, an empty string as the file name, and
ByteArrayInputStream(new byte[0]) as the InputStream.

And yes, it does make sense.

hope that helps,
  Roland




[EMAIL PROTECTED] 
06.03.2005 22:09
Please respond to
"HttpClient User Discussion"


To
[email protected]
cc

Subject
how do u simulate sending a blank file field with httpclient?






Ive been trying to figure out how to send a blank file field with 
httpclient.

Ive managed to work out how to use the multipartform encoded http post and 
can send a file ok, but what i would like to do is to be able to post a 
filepart but not actually send a file, which would simulate a person 
submitting a form that includes a file field, but they havent actually 
chosen a file to submit. 

i hope that makes sense?

the actual http headers that are submitted when no file is selected and 
the form is submitted looks something like this:

----------
Content-Disposition: form-data; name="SomeFile"; filename=""
Content-Type: application/octet-stream
-----------

i have tried things like creating a null file for the filepart or making 
the filename "", but both these methods caused an exception to be thrown.

does anyone know the correct way of doing this? 

cheers,

steve

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


Reply via email to