flysystem is a PHP library that provides an abstraction layer for filesystems. It provides a common API for handling standard tasks across multiple file storage engines, and enables easily swapping local and remote filesystems and emulating directories in systems that don't support them.
Questions tagged [flysystem]
104 questions
84
votes
13 answers
How to get file URL using Storage facade in laravel 5?
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…
daviestar
- 4,017
- 3
- 23
- 43
31
votes
2 answers
Why does Laravel's getMimeType() method identify a file as "application/octet-stream" when the file has the type attribute of "audio/mpeg"?
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…
Kirkland
- 626
- 1
- 8
- 15
27
votes
8 answers
Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade
I am trying to find out how to add in Metadata or headers (Expires, CacheControl etc.) to a file uploaded using the Laravel 5.0 Storage facade. I have use the page here as reference.
http://laravel.com/docs/5.0/filesystem
The following code works…
alexmcfarlane
- 675
- 2
- 7
- 20
18
votes
1 answer
How to leverage the glob method of Filesystem class with StorageFacade?
This is concerning Laravel 5.
I can see in Illuminate\Filesystem\Filesystem a method called glob($pattern, $flags = 0)
Unfortunately, this method is not reflected in the default FilesystemAdapter shipped with Laravel 5.
This would be great, due to…
Réjôme
- 1,454
- 3
- 14
- 25
9
votes
2 answers
How can I use a resource to write line by line but still use Laravel's built in Storage?
I want to use Storage::put to write a file. The file is potentially very large (>100MB), so I want to utilise a stream so I don't blindly place everything into memory.
I'm going to be making multiple API requests, and then looping through their…
Mike
- 8,259
- 8
- 41
- 93
9
votes
1 answer
Laravel's Filesystem with s3 using the wrong url
I am using Laravel's Filesystem to store items on s3 and I am getting the wrong URL.
Storage::disk('s3')->put('file.txt', 'Contents');
Gives me the error
CurlException in CurlMulti.php line 359:
[curl] 6: Could not resolve host:…
whoacowboy
- 5,969
- 6
- 33
- 65
8
votes
3 answers
League/Flysystem fstat() expects parameter 1 to be resource, object given
I am in the process of upgrading a project from Laravel 5 to 5.1. One package that needed to be updated was League\Flysystem.
I am using Intervention\Image to resize an image and then Flysystem to save it to S3. The code below was working with 5.0…
NightMICU
- 8,490
- 25
- 84
- 114
8
votes
2 answers
Laravel 5 Flysystem - download file from remote disk
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/' .…
NightMICU
- 8,490
- 25
- 84
- 114
7
votes
1 answer
PHP 7.0.5: Use of undefined constant FTP_BINARY - assumed 'FTP_BINARY'
Upgrading to PHP 7.0.5 on Windows IIS (finally since the sqlsrv PDO drivers are available). I'm using Laravel 5.1 and when trying to connect to an FTP drive I get the following error from…
dsturbid
- 1,453
- 15
- 21
7
votes
1 answer
Streaming Amazon S3 Objects From a Web Server Using Laravel
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…
Rash
- 6,184
- 1
- 42
- 58
6
votes
2 answers
How to use google cloud storage as Laravel 5 filesystem?
I'm developing an application that lets my users upload files, and I've made it works with "local" disk using filesystem feature, but now I want to migrate and use google Google Cloud Storage for it.
It has been a lot difficult to find some useful…
judasane
- 901
- 2
- 12
- 25
5
votes
1 answer
Flysystem file not found when deleting
I'm trying to delete a photo with Laravel 5.
Storage::delete( asset('/uploads/slides/abcd.jpg'));
Its returning this error:
FileNotFoundException in Filesystem.php line 428:
File not found at path: http:/localhost:8000/uploads/slides/abcd.jpg
If I…
Alan
- 2,319
- 3
- 25
- 46
4
votes
3 answers
How to test a route in Laravel that uses both `Storage::put()` and `Storage::temporaryUrl()`?
I have a route in Laravel 7 that saves a file to a S3 disk and returns a temporary URL to it. Simplified the code looks like this:
Storage::disk('s3')->put('image.jpg', $file);
return Storage::disk('s3')->temporaryUrl('image.jpg');
I want to write…
jelhan
- 5,473
- 1
- 16
- 31
4
votes
2 answers
How to configure OneUpUploaderBundle and OneUpFlysystemBundle to work in Symfony 4.1
Introduction
I am trying out Syfony 4.1 with OneUpUploaderBundle and OneUpFlysystemBundle.
Problem
My configuraton worked fine in Symfony 3.4 yet with Symfony 4.1
i can not figure out how to inject OnUpUploaderBundle in my code in…
Rikijs
- 679
- 1
- 7
- 40
4
votes
1 answer
Calling Flysystem, why do I get PHP Fatal error: Class 'League\Flysystem\Adapter\Local' not found?
I try to run Flysystem's basic example code for the Local adapter and get a Class 'League\Flysystem\Adapter\Local' not found error. This is my process:
version check:
php -v
PHP 5.5.9-1ubuntu4.23 (cli) (built: Feb 8 2018 21:59:47)
install…
jbobbins
- 1,084
- 1
- 13
- 23