Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13410 closed (worksforme)

imagefield errors if upload is larger than FILE_UPLOAD_MAX_MEMORY_SIZE

Reported by: nickname123 Owned by: nobody
Component: File uploads/storage Version: 1.2-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you use an imagefield and upload an image larger than FILE_UPLOAD_MAX_MEMORY_SIZE (which is smaller than digital camera photos by default) you will get the error: 'TemporaryFile' object has no attribute 'closed'

I guess this is due to the file being streaming to disk instead of read to memory and the ImageField calls the function to get the width and height before the file has been completely uploaded.

I would expect the field to wait until the file is fully uploaded to process the image so that it does not throw errors.

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

I can't reproduce this. I've tried uploading large files well in excess of the FILE_UPLOAD_MAX_MEMORY_SIZE and I haven't seen any TemporaryFile error. If you're sure you're seeing this error as a result of a problem in Django, please provide a full set of instructions on how to reproduce the problem; it clearly isn't as simple as "use an ImageField".

comment:2 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.