resume upload wsgi script

Diez B. Roggisch deets at nospam.web.de
Thu Aug 13 10:01:53 CEST 2009


gert schrieb:
> On Aug 10, 10:39 am, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>>> 250KB :)
>> So why do you bother?
>>
>>> Its just HTTP1.1 has everything for making ftp like file transfers
>>> possible.
>>> When I write it to a file then I am back at square one because I still
>>> need to load it completely to get it into a blob.
>> Well, the blob is nothing but datat in the file-system. If you are
>> *really* concerned about that, then don't use the db, but use the
>> filesystem, appending to the file until it's finished - and storing a
>> reference to it to the DB. We do that as well, because otherwise the db
>> will become unmanagable anyway (dumping, backups).
>>
> 
> I also hate debugging sql that contains blob data. So if using files
> how do you clean the http post stuff?
> (b+r'.*?Content-Type: application/octet-stream\r\n\r\n(.*?)\r
> \n--'+b,file,DOTALL)
> using as litlle memory as possible ?
> I can not use PUT upload only because flash does not support PUT.

PUT or POST has nothing todo with that.

It's the question if you need formencoded data or not. If not, you can 
simply upload the data directly, no nead to cleanup anything.

For decoding formencoded data, you will need to write your own parser if 
you insist on these very debatable memory-constraints of yours.

Diez



More information about the Python-list mailing list