len(x) uses an uint32 integer internally, which breaks very large uploads
Proper way to get file sizes in upload_file