1
I’m saving a file on Amazon’s AWS S3, the file is being saved but it puts an underline and a number in front, as shown below:
And this is in the way of getting the URL of the PDF to show the PDF to the user, you could take this number, or a function that takes the URL of the object?
I tried this but it doesn’t bring the Object URL:
$Url=Storage::disk('s3')->url($filename);
Code that is saving the file on the server:
$filenamewithextension = $request->file('doc')->getClientOriginalName();
$dia=date('d/m/Y');
$horario=date("H.i.s");
$id=Auth::user()->id;
$filename ='teste';
$extension = $request->file('doc')->getClientOriginalExtension();
$filenametostore = $filename.'_'.time().'.'.$extension;
Storage::disk('s3')->put($filenametostore, fopen($request->file('doc'), 'r+'), 'public');