flysystem

Streaming Amazon S3 Objects From a Web Server Using Laravel

倖福魔咒の 提交于 2019-12-04 07:36:12
In my web-application built using laravel 5.1, users can upload some sensitive files that I store in Amazon S3. Later I want users WITH PERMISSION to download this file. Since I want this auth check in place, I cannot download the file using traditional methods by giving them direct link to file in S3. My approach: When user requests a download, my servers download the file locally and then stream to user. Issue: Takes long time because files are too large sometimes. Give the user a pre-signed URL to download directly from S3. URL is only valid for 5 minutes. Issue: If that URL is shared,

Why does Laravel's getMimeType() method identify a file as “application/octet-stream” when the file has the type attribute of “audio/mpeg”?

余生长醉 提交于 2019-12-03 12:21:05
问题 I'm trying to upload a MP3 file to a Laravel application and have ran into an issue where even though the file has an attribute set to "audio/mpeg" it is uploaded as a "application/octet-stream" (.bin) file. When I try to die and dump the file on the server-side code with: dd($request->file('file')); I get: UploadedFile {#187 ▼ -test: false -originalName: "CUS12309821-20-AUG-2016-13-48-13.mp3" -mimeType: "audio/mpeg" -size: 47000471 -error: 0 path: "/private/var/folders/c7/6ws0lxy95dd

Why does Laravel's getMimeType() method identify a file as “application/octet-stream” when the file has the type attribute of “audio/mpeg”?

旧街凉风 提交于 2019-12-03 01:55:54
I'm trying to upload a MP3 file to a Laravel application and have ran into an issue where even though the file has an attribute set to "audio/mpeg" it is uploaded as a "application/octet-stream" (.bin) file. When I try to die and dump the file on the server-side code with: dd($request->file('file')); I get: UploadedFile {#187 ▼ -test: false -originalName: "CUS12309821-20-AUG-2016-13-48-13.mp3" -mimeType: "audio/mpeg" -size: 47000471 -error: 0 path: "/private/var/folders/c7/6ws0lxy95dd_lhz1k067_zkc0000gn/T" filename: "phpyZCsbU" basename: "phpyZCsbU" pathname: "/private/var/folders/c7

Laravel 5 Flysystem - download file from remote disk

筅森魡賤 提交于 2019-11-30 09:17:24
I am storing files for a site on Rackspace using Flysystem. Uploading is no problem, having trouble figuring out how to start a download for a file - this is what I have tried Storage::disk('rackspace'); return response()->download('file-library/' . $file->filename); The result is that the file could not be found. Is adding Storage::disk() sufficient for making Laravel look in this location rather than locally? What is the best way to accomplish this? Frank de Jonge Frank here from Flysystem. The preferred way to do this would be to use the readStream output in combination with Response:

How to get file path using Storage facade in laravel 5?

拟墨画扇 提交于 2019-11-27 06:52:00
I've been experimenting using the new Flysystem integration with Laravel 5. I am storing 'localised' paths to the DB, and getting the Storage facade to complete the path. For example I store screenshots/1.jpg and using Storage::disk('local')->get('screenshots/1.jpg') or Storage::disk('s3')->get('screenshots/1.jpg') I can retrieve the same file on different disks. get retrieves the file contents, but I am hoping to use it in my views like this: <img src="{{ Storage::path('screenshots/1.jpg') }}" /> but path, or anything able to retrieve the full path is not available (as far as I can see). So