xibosignage / xibo

Xibo Digital Signage
https://xibosignage.com
GNU Affero General Public License v3.0
575 stars 165 forks source link

File Upload: Reduce the number of copies that move around #1395

Open dasgarner opened 6 years ago

dasgarner commented 6 years ago

The uploaded file arrives in PHP /tmp

Then Xibo moves the file out of the tmp folder, into its own library/temp folder where it does some post processing on it (like finding out the duration of the video).

Finally, once the post processing has been completed, we move the file again - this time into the /library folder itself, with its final name.

dasgarner commented 6 years ago

This does what it does because of support for things like chunked uploads, XHR form data, Blob API, etc, etc. Chunked uploads absolutely require that the file is not stored in a "php temporary" location - i.e. that they are moved out into library/temp as they currently are.

As nice as it would be to solve this problem in 1.8 series, it will be a complete rewrite of the file upload functionality, which I do not think appropriate for a patch version change.