Large file uploads

18 views
Skip to first unread message

Recital Recital

unread,
Nov 3, 2017, 2:28:27 AM11/3/17
to 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
Reply all
Reply to author
Forward
0 new messages