Admin interface should provide option for allowing the admin to specify the location of the file using a relative path. Currently it only allows the admin to upload a file.
|Reported by:||mueen@…||Owned by:||nobody|
|Severity:||Keywords:||admin file FileField upload path|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Here's the scenario I'm suffering from.
My model has a FileField. Basically, I need to create new instances from time to time. Each instance has two files - one about 15 MB and the other about 25 MB.
In the Admin interface, when I try to create a new interface, it wants me to upload the files. If I try that, I get a 500 Error - most likely the process is running out of memory (using FastCGI with Apache).
Now the database does not hold the whole file - only the relative path to it. If I could manually upload the file (FTP, etc), and simply supply the path in the Admin interface, my life would be made easier. As it stands, I have to manually edit the paths in MySQL. So it would be nice if the Admin interface provided both options: Uploading and specifying local paths.
Of course, this solution is not ideal (although it does make handling files more flexible). I'm told the reason I have this problem is that Django tries to keep the whole file in memory before it dumps it to disk. I don't know if there's a ticket open for it, but it would make more sense if Django would write to disk as it reads the file from the upload process. (I'll gladly accept any corrections to my reasoning - I'm Django newbie).
Change History (5)
comment:1 in reply to: ↑ description Changed 7 years ago by Collin Grady <cgrady@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 Changed 7 years ago by Simon Greenhill <dev@…>
- Triage Stage changed from Unreviewed to Design decision needed