mardi 11 juillet 2017

Get information about a file uploaded to S3

I've uploaded a file to S3:

Storage::disk('s3')->putFileAs(
    $directory, $request->file('image'), 'filename.png'
);

My first question is: can I get information about the uploaded file (its URL, contents, etc.) without having to do a GET request to S3? In other words, can I get information about the file from the POST/PUT request I just made?

My second question is: how can I get information about the file using a single method?

Right now, in order to get the URL, I do:

Storage::disk('s3')->url($pathToFile);

And to get the file's contents, I do:

Storage::disk('s3')->get($pathToFile);

This means I have to do two separate GET requests to S3 (meaning more cost to me). Is there a way to get ALL of the file's information in a single request?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2vazWGi
via IFTTT

Aucun commentaire:

Enregistrer un commentaire