bo-yang / plan9front

Automatically exported from code.google.com/p/plan9front
0 stars 0 forks source link

mothra / abaco: implement file uploads and multipart/mime #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
we dont support multipart form encoding.

you can set the content type for the post
in webfs already. whats missing is support
for it in mothra and abaco.

Original issue reported on code.google.com by cinap_le...@felloff.net on 24 May 2012 at 12:45

GoogleCodeExporter commented 9 years ago
http://www.ietf.org/rfc/rfc2388.txt

Original comment by cinap_le...@felloff.net on 24 May 2012 at 12:59

GoogleCodeExporter commented 9 years ago
changed mothras webfs code.

now there is: 

urlget(Url *url, int post);

for a normal GET request post is -1, for a POST, it takes the filedescriptor
of the postbody file of a preexisting webfs connection. to get it, you call:

urlpost(Url *url, char *ctype);

that takes the url to post against and an optional Content-Type string.

example:

int post, body;

// start post
post = urlpost(u, "multipart/form-data");
// write the postbody
write(post, ....);
// complete the request
body = urlget(u, post);

geturl() now basicly calls urlget() and also takes the post
file descriptor instead of method and char *post buffer.

Original comment by cinap_le...@felloff.net on 25 May 2012 at 9:10

GoogleCodeExporter commented 9 years ago
test

Original comment by cinap_le...@felloff.net on 18 Jun 2012 at 2:57

GoogleCodeExporter commented 9 years ago
test

Original comment by cinap_le...@felloff.net on 18 Jun 2012 at 7:25

GoogleCodeExporter commented 9 years ago

Original comment by cinap_le...@felloff.net on 18 Jun 2012 at 7:30