You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've built a simple file uploading example to learn the intricacies of AWS/S3.
I'm using Livewire and while I'm storing my media in S3, I've toyed with both local and S3 for the temporary upload location.
In doing so, I've noticed that when using the local file system for the temporary upload that the file name after storing the file in the media disk is the actual name of the file rather than some random string/hash. However, when using S3 as the temporary upload location, the file name is a random string/hash.
I know there are security implications when storing files as the original file names on local storage but perhaps this isn't an issue since it's still being stored on S3 but I'm curious why this behaviour is happening still.
For example when using S3 for both temporary uploads and the media disk:
After looking into this more, it appears that storing the file as its original name is the default behaviour and it's because the addMediaFromDisk() method is now taking the temporary file name and assuming it's the uploaded file's original name.
The problem though is that using addMedia() method doesn't work if using S3 as the temporary upload location and alternatively doing ->addMediaFromDisk($this->photo, 's3') doesn't work either.
I've built a simple file uploading example to learn the intricacies of AWS/S3.
I'm using Livewire and while I'm storing my media in S3, I've toyed with both local and S3 for the temporary upload location.
In doing so, I've noticed that when using the local file system for the temporary upload that the file name after storing the file in the media disk is the actual name of the file rather than some random string/hash. However, when using S3 as the temporary upload location, the file name is a random string/hash.
I know there are security implications when storing files as the original file names on local storage but perhaps this isn't an issue since it's still being stored on S3 but I'm curious why this behaviour is happening still.
For example when using S3 for both temporary uploads and the media disk:
For example when using local for the temporary uploads and S3 as the media disk:
The text was updated successfully, but these errors were encountered: