client to upload big files via https and get progress info

James Mills prologic at shortcircuit.net.au
Thu May 13 12:02:24 EDT 2010


On Wed, May 12, 2010 at 6:48 PM, News123 <news1234 at free.fr> wrote:
> Hi,
>
> I'd like to perform huge file uploads via https.
> I'd like to make sure,
> - that I can obtain upload progress info (sometimes the nw is very slow)
> - that (if the file exceeds a certain size) I don't have to
>  read the entire file into RAM.
>
> I found Active states recipe 146306, which constructs the whole
> multipart message first in RAM and sends it then in one chunk.
>
>
> I found a server side solutions, that will write out the data file chunk
> wise ( http://webpython.codepoint.net/mod_python_publisher_big_file_upload
> )
>
>
>
> If I just wanted to have progress info, then I could probably
> just split line 16 of Active State's recipe ( h.send(body) )
> into multiple send, right?
>
> chunksize = 1024
> for i in range(0,len(body),chunksize):
>    h.send(body[i:i+chunksize])
>    show_progressinfo()
>
>
> But how could I create body step by step?
> I wouldn't know the content-length up front?
>
> thanks in advance

My suggestion is to find some tools that can
send multiple chucks of data. A non-blocking
i/o library/tool might be useful here (eg: twisted or similar).

cheers
James



More information about the Python-list mailing list