Large file uploads

21 wyświetleń
Przejdź do pierwszej nieodczytanej wiadomości

Recital Recital

nieprzeczytany,
3 lis 2017, 02:28:273.11.2017
do web.py
I am using the standard recipe for large file uploads.


class Update:
    def POST(self, name=''):

        params = web.input(filedata={})
...


The call web.input(filedata={}) seems to instantiate a dictionary with the contents of the file from the multipart POST.
I am running on an embedded system and do not have adequate memory or swap area to load the file in memory

The operation breaks with a pipe error on the lighttpd side.
Is there any way to force the call to not load all the data.

It seems to be read from a file descriptor on the storage operation.

with open(update_path, 'wb') as fp:
            fp.write(params.filedata.file.read())

Thanks
Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0