Comments (15)
It sounds like this is an issue with elFinder? I haven't looked too thoroughly but they don't appear to depend on our package.
from flysystem-google-cloud-storage.
I can edit files on a local file system, just not in GCS, so I'm sure its connected to your package?
from flysystem-google-cloud-storage.
How are you trying to edit the file(s)?
Can you paste me the sample code?
from flysystem-google-cloud-storage.
I am right clicking and selecting edit file. Code wise, I am using the most basic connector with a GCS adapter and the minimum code for the client.
public function elfinder_init()
{
$this->load->helper('path');
$opts = array(
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => set_realpath('files'),
'URL' => base_url('files') . '/'
),
array(
'driver' => 'Flysystem',
'alias' => 'GCS assets',
'URL' => 'https://storage.googleapis.com/assets/',
'filesystem' => new Filesystem($this->googleCloud('assets')),
'separator' => '/',
'defaults' => array('read' => true, 'write' => true)
),
)
);
$this->load->library('elfinder_lib', $opts);
}
<script type="text/javascript" charset="utf-8">
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
$(document).ready(function() {
$('#elfinder').elfinder({
url : '<?php echo site_url('ex_cont/elfinder_init'); ?>'
});
});
</script>
from flysystem-google-cloud-storage.
Yet you're still only showing thirdparty code.
from flysystem-google-cloud-storage.
Because that's all's I'm using...
from flysystem-google-cloud-storage.
But @matthewgoslett has no cigar about elfinder and how it utilizes the driver once created. Can you dig a little deeper on the other side such as checking the correct base - URL for your bucket? Also this example misses what this->googleCloud
does.
from flysystem-google-cloud-storage.
OK, I got more information on this. Please see Studio-42/elFinder#1300 for more info, as well as thephpleague/flysystem#627
Basically, you cannot edit a new text file (empty file, 0b) in GCS, as the contents are returned as false, which gets passed through and matched as an error.
If the text file is empty, the content should be returned as such (null
or ""
?)
Chap from Flysystem has pointed this towards you guys, so can you please investigate?
from flysystem-google-cloud-storage.
Any ideas?
from flysystem-google-cloud-storage.
I'm busy looking at this now
from flysystem-google-cloud-storage.
I'm able to replicate this, busy looking at a fix.
The GoogleClient $this->service->objects->get() call returns false when the object is empty (size 0).
from flysystem-google-cloud-storage.
Thanks for reporting this issue.
It's now fixed in https://github.com/Superbalist/flysystem-google-storage/releases/tag/1.0.3
from flysystem-google-cloud-storage.
Just downloaded 1.0.3 and it doesn't work. Still getting false for an empty text file.
from flysystem-google-cloud-storage.
I'm unable to replicate this using 1.0.3.
$result = $filesystem->put('blank.txt', '');
var_dump($result); // boolean true
$contents = $filesystem->read('blank.txt');
var_dump($contents); // null
from flysystem-google-cloud-storage.
Well I'm not sure what to tell you, but it is not working for me.
On line 260, $contents
doesn't seem to be populated from $this->service->objects->get($this->bucket, $path, ['alt' => 'media']);
Putting a break point on that line, and stepping down to the next line (the IF statement), $contents
is not present in my variables list in my IDE.
from flysystem-google-cloud-storage.
Related Issues (20)
- Renaming and moving Folders does not work HOT 1
- Function getOptionsFromConfig() is not working HOT 1
- undefined method: getUrl(); HOT 1
- get url from firebase storage using php
- has function does not return true for directories HOT 2
- upload fails with uniform access controls HOT 4
- ReadMe Correction for getUrl
- Supporting Flysystem 2.x HOT 4
- Getting 404 when i try to delete directory.
- File stream is dropped on writeStream() HOT 5
- Question: is it possible to set Cache-Control? HOT 1
- Authetification Issue HOT 2
- What's the status of this project? HOT 2
- Dependencies flysystem
- Generated URLs are not RFC 3986 compliant HOT 1
- How to delete a dir with millions of files?
- PHP Warning thrown after asset Uploaded - stream provided gets corrupted HOT 1
- GoogleStorageAdapter::deleteDir fails to delete a directory HOT 2
- Is there a reason to explicitly set the visibility if not passed? HOT 7
- Changes to google api endpoint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flysystem-google-cloud-storage.