I'm having a problem with file uploading. I'm using FastCGI on Apache2 (unix) to run a WSGI-compliant application. File uploads, in the form of images, are begin saved in a MySQL database. However, larger images are being truncated at 65535 bytes. As far as I can tell, nothing should be limiting the size of the files and I'm not sure which one of the pieces in my solution would be causing the problem.
Is it FastCGI; can it limit file upload sizes?
Is it Python? The cgi.FieldStorage
object gives me a file handle to the uploaded file which I then read: file.read()
. Does this limit file sizes in any way?
Is it MySQL? The type of the column for saving the image data is a longblob
. I figured this could store a couple of GB worth of data. So a few MB shouldn't be a problem, right?
Is it the flups WSGIServer
? I can't find any information regarding this.
My file system can definitely handle huge files, so that's not a problem. Any ideas?
UPDATE:
It is MySQL. I got python to output the number of bytes uploaded and it's greater than 65535. So I looked into max_allowed_packet
for mysqld
and set it to 128M. Overkill, but wanting to be sure for the moment.
My only problem now is getting python's MySQLdb
to allow the transfer of more than 65535 bytes. Does anyone know how to do this? Might post as a separate question.