flysystem

Laravel Flysystem WebDav list directory

大城市里の小女人 提交于 2021-01-28 10:10:49
问题 I'm trying to get list of directory on WebDav through Flysystem however is it empty. I'm using Laravel Graham's Campbell integration of Flysystem: dump(Flysystem::listContents('test')); gives me empty array while dump(Flysystem::read('/test/test2.txt')); gives me content of file. Could you please help me understand what I'm doing wrong? Thank you! 来源: https://stackoverflow.com/questions/45993733/laravel-flysystem-webdav-list-directory

How to leverage the glob method of Filesystem class with StorageFacade?

99封情书 提交于 2020-01-23 04:21:12
问题 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 the fact that I would need to do something like Storage::disk('local')->glob([_]*[.blade.php]); (in order to get all stored blade files starting with an underscore. What is the cleanest way to achieve this? 回答1: I think you cannot run glob here, but

Flysystem/CSV filter a subset of columns

我与影子孤独终老i 提交于 2019-12-25 06:12:35
问题 Is it possible to filter a subset of columns of a CSV with Flysystem CSV? I know that you can use AbstractCsv::addFilter(callable $callback) to add arbitrary filters, but I don't think you would use this to drop a column. 回答1: I solved this by getting an array of the column positions that I wanted to filter out. Then, by setting up a new CSV object to write to e.g. $new = Writer::createFromFileObject(new \SplTempFileObject); With the CSV to read from, I used the each method to iterate through

Laravel 5 Flysystem - download file from remote disk

社会主义新天地 提交于 2019-12-18 13:17:35
问题 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? 回答1: Frank here from Flysystem. The

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

僤鯓⒐⒋嵵緔 提交于 2019-12-17 08:47:46
问题 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') }

Connecting to softlayer object storage using openstack API library php-opencloud

╄→гoц情女王★ 提交于 2019-12-11 11:09:55
问题 Is there someone tried to connect to softlayer object storage using the php-opencloud library? I got 400 bad response when the library trying to make authentication. From what I see inside the php-opencloud library, It use authentication method described here, it uses v2/token and softlayer object storage using v1. Does softlayer object storage that based on the same openstack doesn't support the authentication v2? I can connect to the object storage using sdk(softlayer-object-storage-php)

PHP 7.0.5: Use of undefined constant FTP_BINARY - assumed 'FTP_BINARY'

左心房为你撑大大i 提交于 2019-12-10 15:39:03
问题 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 https://github.com/thephpleague/flysystem/blob/master/src/Adapter/Ftp.php#L19. Use of undefined constant FTP_BINARY - assumed 'FTP_BINARY' This is a PHP constant for the transfer, so shouldn't have a problem and there's nothing in the docs to say it's deprecated or anything. FTP_ASCII is the same. The only

Laravel - Passing a PHP resource to Storage::put

血红的双手。 提交于 2019-12-06 04:57:46
问题 The Laravel docs (https://laravel.com/docs/5.2/filesystem#storing-files) state this: Storing Files The put method may be used to store a file on disk. You may also pass a PHP resource to the put method, which will use Flysystem's underlying stream support. Using streams is greatly recommended when dealing with large files: Storage::put('file.jpg', $contents); Storage::put('file.jpg', $resource); I am looking to save a file larger than my php memory limit (512MB), so when I do this, I get a

Streaming Amazon S3 Objects From a Web Server Using Laravel

回眸只為那壹抹淺笑 提交于 2019-12-06 02:06:22
问题 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

How to leverage the glob method of Filesystem class with StorageFacade?

妖精的绣舞 提交于 2019-12-04 22:51:01
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 the fact that I would need to do something like Storage::disk('local')->glob([_]*[.blade.php]); (in order to get all stored blade files starting with an underscore. What is the cleanest way to achieve this? I think you cannot run glob here, but you could get all files and then filter them, for example: $files = array_filter(Storage::disk('local')-