views:

29

answers:

1

I'm writing a client in python to upload a file to a webserver I run. On the PHP side, it seems I should expect the file to arrive in the $_FILES variable, but I can't find any documentation on how that variable gets populated. I can find tutorials on how to create web forms to upload, but none of them tell me what the actual HTTP POST looks like. I'm assuming that there is a standard for what parameters to populate and what content-type to specify, but I can't find it stated anywhere.

+2  A: 

It's the multipart/form-data encoding which is described in RFC 1867 and RFC 2388.

BalusC
Is that the only way? It seems python's urllib doesn't support that encoding.
directedition
I don't do Python, but your search keyword is likely ["HTTP client"](http://www.google.com/search?q=python+http+client). To the point, it's not that hard. Just open a TCP/IP socket and write the bytes the way as it's specified in the RFC specification.
BalusC