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