Show More
@@ -304,7 +304,7 b' class PostForm(NeboardForm):' | |||||
304 | # Download file, stop if the size exceeds limit |
|
304 | # Download file, stop if the size exceeds limit | |
305 | size = 0 |
|
305 | size = 0 | |
306 | content = b'' |
|
306 | content = b'' | |
307 |
for chunk in response.iter_content( |
|
307 | for chunk in response.iter_content(FILE_DOWNLOAD_CHUNK_BYTES): | |
308 | size += len(chunk) |
|
308 | size += len(chunk) | |
309 | self.validate_file_size(size) |
|
309 | self.validate_file_size(size) | |
310 | content += chunk |
|
310 | content += chunk | |
@@ -315,7 +315,7 b' class PostForm(NeboardForm):' | |||||
315 | filename = 'file.' + content_type.split('/')[1] |
|
315 | filename = 'file.' + content_type.split('/')[1] | |
316 | img_temp = SimpleUploadedFile(filename, content, |
|
316 | img_temp = SimpleUploadedFile(filename, content, | |
317 | content_type) |
|
317 | content_type) | |
318 | except Exception: |
|
318 | except Exception as e: | |
319 | # Just return no file |
|
319 | # Just return no file | |
320 | pass |
|
320 | pass | |
321 |
|
321 |
General Comments 0
You need to be logged in to leave comments.
Login now