Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipart file upload example? #5

Open
rflynn opened this issue May 3, 2012 · 5 comments
Open

multipart file upload example? #5

rflynn opened this issue May 3, 2012 · 5 comments

Comments

@rflynn
Copy link

rflynn commented May 3, 2012

I'm having trouble figuring out how to perform a multipart file upload and don't see any examples and haven't found anything via google. Any chance you could add one?

@oscarh
Copy link
Owner

oscarh commented May 4, 2012

Do you mean the partial upload feature or chunked encoding?

Ryan Flynn [email protected] wrote:

I'm having trouble figuring out how to perform a multipart file upload and don't see any examples and haven't found anything via google. Any chance you could add one?


Reply to this email directly or view it on GitHub:
#5

@rflynn
Copy link
Author

rflynn commented May 5, 2012

Yes, in that POST and chunked transfer encoding is not multipart uploading (http://www.ietf.org/rfc/rfc2388.txt).

I am trying to reproduce the results of the following multipart curl upload:

pizza@pizza:~$ echo -n a > 1byte
pizza@pizza:~$ nc -l 8888 &
[1] 25085
pizza@pizza:~$ curl -X POST -F file=@1byte http://localhost:8888/
POST / HTTP/1.1
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: localhost:8888
Accept: */*
Content-Length: 198
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------0a833808c0ae

------------------------------0a833808c0ae
Content-Disposition: form-data; name="file"; filename="1byte"
Content-Type: application/octet-stream

a
------------------------------0a833808c0ae--

^C

[1]+  Stopped                 nc -l 8888

As far as I can tell lhttpc does not have this capability, but perhaps I'm missing something?

@rflynn
Copy link
Author

rflynn commented May 10, 2012

Related RFC: "Form-based File Upload in HTML" http://www.ietf.org/rfc/rfc1867.txt

@oscarh
Copy link
Owner

oscarh commented May 14, 2012

Not sure I'll find the time to take a look at this, but if you ping etc, they're probably more active on their version of lhttpc.

@oscarh
Copy link
Owner

oscarh commented May 14, 2012

Hmm, maybe you just need to provide the header:

Content-Type: multipart/form-data; boundary=----------------------------0a833808c0ae

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants