We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having trouble retrieving the contents of a file. I've created an array of files using the following:
$service = Storage::cloud()->getAdapter()->getService(); $files = Storage::cloud()->listContents('/');
I'm then looping that array and running the following:
$export = $service->files->export($file['path'], 'text/plain'); $contents = $export->getBody();
The above returns a Guzzle stream, so if I change the $contents variable to the following to retrieve the contents, I instead see an empty string:
$contents
$contents = $export->getBody()->getContents();
I have also tried using $file['basename'] instead of $file['path'] , but I see the same results.
$file['basename']
$file['path']
$service = Storage::cloud()->getAdapter()->getService(); $files = Storage::cloud()->listContents('/', false); foreach ($files as $file) { if ($file['name'] == 'test') { $export = $service->files->export($file['path'], 'text/plain'); $contents = $export->getBody()->getContents(); dd($contents); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm having trouble retrieving the contents of a file. I've created an array of files using the following:
I'm then looping that array and running the following:
The above returns a Guzzle stream, so if I change the
$contents
variable to the following to retrieve the contents, I instead see an empty string:I have also tried using
$file['basename']
instead of$file['path']
, but I see the same results.Full code if it's needed
The text was updated successfully, but these errors were encountered: