This is not so much an issue more of a suggestion to explain a frustrating edge case when uploading files.
If uploading to a bucket where uniform access is enabled and the visibility setting within the package confguration is publicor private, a League\Flysystem\UnableToWriteFile exception will be thrown, stating Unable to write file at location.
If you follow this exception to League\Flysystem\GoogleCloudStorage@upload() the actual exception states: Cannot insert legacy ACL for an object when uniform bucket-level access is enabled.
Hi,
This is not so much an issue more of a suggestion to explain a frustrating edge case when uploading files.
If uploading to a bucket where uniform access is enabled and the visibility setting within the package confguration is
public
orprivate
, aLeague\Flysystem\UnableToWriteFile
exception will be thrown, statingUnable to write file at location
.If you follow this exception to
League\Flysystem\GoogleCloudStorage@upload()
the actual exception states:Cannot insert legacy ACL for an object when uniform bucket-level access is enabled
.This situation is already handled by Flysystem, see https://github.com/thephpleague/flysystem/pull/1357.
The fix here is to set the visibility within the file system config as follows:
Note the string is a constant within the Flysystem repository at https://github.com/thephpleague/flysystem/blob/3.x/src/GoogleCloudStorage/PortableVisibilityHandler.php#L14 and could be therefore be defined as:
Would you accept an update to the package readme that briefly explains this, as
noPredefinedVisibility
is not mentioned.Thanks