From: Ian B. <ia...@co...> - 2001-11-09 23:33:21
|
ir...@se... (Mike Orr) wrote: > On Fri, Nov 09, 2001 at 05:07:14PM -0600, Ian Bicking wrote: > > How inefficient is it to upload files via HTTP vs. FTP? I get the > > impression there's some sort of encoding in HTTP, but I'm not sure, > > and I'm not sure how bad it is. > > I know ppl that claim HTTP is more efficient than FTP for downloading, > because FTP has to open and close a data connection for each while > still keeping a control connection open, while HTTP can just send > everything down one connection with keepalive. Apparently that > translates to lower server load for HTTP. Perhaps the same is > true for uploading. I'm more concerned if the file ends up being URL-encoded, or even base64-encoded... that would expand the file size considerably. Latency or whatever isn't too concerning in comparison. > > If I do an upload via HTTP, how can I do the client side in Python? > > urllib.urlencode(vars) works for normal POST, right? But I have the > > impression there's something more complicated (MIME-like) for image > > uploading (the multipart/form-data enctype...?) > > I think you want to use HTTP PUT, not POST, to upload. But I haven't > done it. Can Webware respond to PUT? I only vaguely even remember hearing about that command. I was thinking more of a form, like: <form enctyp="multipart/form-data" method="POST"> <input type="file" name="file"> </form> Then you get the file as a POST variable. I don't know exactly what the browser does with this. Ian |