FileUpload: Run function on file before uploading to S3
I need to detect the duration of a video with something like ffmpeg before it gets uploaded to S3. Is this at all possible, or is the FileUpload streaming to S3 and there's no temporary file on the system that I can run ffmpeg on?
Otherwise, I will have to make a background job that downloads the file later and gets the duration.
2 Replies
It's doable with
FileUpload
- you might have to change the process though. Instead of sending the file to S3 directly, save it locally and move to S3 only after you're done processing it
Docs should cover most of what you need.If you setup the temporary directory of Livewire as S3 it get's uploaded directly. I would go the route with keeping it that way and check the file afterwards.