tickets: 9631
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9631 | 2008-11-19 06:20:05 | 2019-01-09 22:07:55 | 2022-03-06 03:45:20.169599 | Design decision needed | new | File uploads/storage | Cleanup/optimization | Normal | 1.11 | FieldFile assumes efficient Storage.size | FieldFile's _get_size, like many of its methods, passes the operation on to its Storage object. However, in this case, assuming that a storage mechanism can easily discover the size of a file by name is rather rash. If the file is compressed, for instance, it may be necessary to decompress the entire file to determine the size. Remote storage could suffer from similar issues. Fortunately, FieldFile has a File object provided by the storage. The Storage derivative is responsible for returning a valid File object, which means it must be able to correctly report its size. By asking the File object for its size directly, we provide opportunities for caching so that a size request followed by a read operation need not trigger two independent retrievals of the data. | nobody | psagers | file upload compression | 0 | 1 | 1 | 0 | 0 | 0 |