Created
June 2, 2021 11:32
-
-
Save kenmasters/923d87d3feab4b8bbd35250fe1def9b8 to your computer and use it in GitHub Desktop.
Laravel: Upload file object to specific folder and set custom filename
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($file = $request->file('inputFieldNameOfTypeFile')) { | |
$extension = $file->getClientOriginalExtension(); | |
$filename = 'customFilename'.'.'.$extension; | |
$courier->tblColumn = Storage::putFileAs($foldername, $file, $filename); // return file absolute path only not the full url | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment