Project

General

Profile

Actions

Defect #33752

closed

Uploading a big file fails with NoMemoryError

Added by Karel Pičman over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Uploading of a file bigger than available RAM fails with no memory error. I've found the reason in request.raw_post which is String and doesn't respond to :read. Consequently, the whole file is read into memory. The attached patch simply replaces raw_post with body which is type of StringIO that provides read method.


Files

big_files_upload.diff (594 Bytes) big_files_upload.diff Karel Pičman, 2020-07-20 08:54
attachments_test.rb.patch (1.22 KB) attachments_test.rb.patch Pavel Rosický, 2020-07-20 23:57
file_size.diff (1.16 KB) file_size.diff Karel Pičman, 2020-07-21 09:37
10-patches.rb.patch (621 Bytes) 10-patches.rb.patch Pavel Rosický, 2020-08-24 12:16
33752.patch (2.36 KB) 33752.patch patch by Karel Pičman and Pavel Rosický Go MAEDA, 2021-05-08 09:56

Related issues

Related to Redmine - Defect #35715: File upload fails when run with uWSGIClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF