Web2py freezes when uploading a file greater than IS_LENGTH maxsize

49 views
Skip to first unread message

William Chen

unread,
Feb 19, 2015, 5:53:45 AM2/19/15
to web...@googlegroups.com
Hi all,

Background:
I have created a file upload form where you can upload any file smaller than 1MB. 

This is the db field for the file:

Field('file1', 'upload', requires = IS_LENGTH(minsize=0, maxsize=1048576, error_message='File is too huge.')),

Problem:
When I try to upload a huge file larger than 1MB, Web2py freezes up for up to 2 minutes, before finally returning to the form showing the error_message that 'file is too huge'. I am unable to access any other part of my application when web2py freezes. 

Question:
Is there any way to work around this problem? For example, is there anyway to check the size of file before uploading it? 

Willoughby

unread,
Feb 19, 2015, 4:12:50 PM2/19/15
to web...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages