As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
I uploaded a file by REST API and made it public while upload (_public = true). While I can access any non public uploaded file the "public" file is not readable (accessing from console):
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous caller does not have storage.objects.get access to 4161a22b4be84bb5b6edf024782ddb8d/b19bac94-fc1c-aec2-ac8b-600e34642d37/GNLP94N.png.
</Details>
</Error>
The same happens using the provided link after uploading.
That's the key line uploading the file with the public option (PHP, cUrL):
I know this worked once (and I haven't changed the code in between). I have checked for any changed documentation regarding this but couldn't find anything.
Pranav has access to my console. Feel free to reproduce the problem by visiting my console > file storage and clicking on file "GNLP94N.png" in the column "_downloadURL".
Any other files (not public) are accessible there.
Regards
Best Answer
M
Martin Apostolov
said
almost 5 years ago
Hi Tayger,
One of the options for the above error is if the upload to Google Cloud Storage failed and thus the stored metadata in Kinvey points to a non-existing file in Google Cloud Storage.
Could you please confirm if the second request to Google Cloud Storage (when making a request to _uploadURL) succeeded?
Please note that unlike private files, when uploading a public file (_public: true) would return not only the _uploadURL but also _requiredHeaders that should be included in the second request to GCS:
One of the options for the above error is if the upload to Google Cloud Storage failed and thus the stored metadata in Kinvey points to a non-existing file in Google Cloud Storage.
Could you please confirm if the second request to Google Cloud Storage (when making a request to _uploadURL) succeeded?
Please note that unlike private files, when uploading a public file (_public: true) would return not only the _uploadURL but also _requiredHeaders that should be included in the second request to GCS:
Not including the above headers in the second request to GCS would lead to failed request/upload and thus you may end up with the described error.
Let me know if this was the case.
Regards
Martin
T
Tayger
said
almost 5 years ago
Hello Martin
Thank you for the appreciated help and yes, that was it!
The additional difficulty to find the problem is the fact that the upload command does not receive any return code/status. So you don't know really whether the upload worked or not.
I remember the google cloud header was empty at the time I created the code around it. So there was not header required at that time. I have checked it now and yes, there is a google header. Thats why my public upload didn't work anymore. I just forgot about the header part.
Since that can change anytime again the header preparation should be done dynamically. From PHP/cURL perspective I post my solution here for anyone else. Since a simple JSON encode does not work here, you have to send an array:
1. Get the returned array from requesting a public file creation:
Tayger
Hello
I uploaded a file by REST API and made it public while upload (_public = true). While I can access any non public uploaded file the "public" file is not readable (accessing from console):
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous caller does not have storage.objects.get access to 4161a22b4be84bb5b6edf024782ddb8d/b19bac94-fc1c-aec2-ac8b-600e34642d37/GNLP94N.png.
</Details>
</Error>
The same happens using the provided link after uploading.
That's the key line uploading the file with the public option (PHP, cUrL):
I know this worked once (and I haven't changed the code in between). I have checked for any changed documentation regarding this but couldn't find anything.
Pranav has access to my console. Feel free to reproduce the problem by visiting my console > file storage and clicking on file "GNLP94N.png" in the column "_downloadURL".
Any other files (not public) are accessible there.
Regards
Hi Tayger,
One of the options for the above error is if the upload to Google Cloud Storage failed and thus the stored metadata in Kinvey points to a non-existing file in Google Cloud Storage.
Could you please confirm if the second request to Google Cloud Storage (when making a request to
_uploadURL
) succeeded?Please note that unlike private files, when uploading a public file (
_public: true
) would return not only the_uploadURL
but also_requiredHeaders
that should be included in the second request to GCS:Not including the above headers in the second request to GCS would lead to failed request/upload and thus you may end up with the described error.
Let me know if this was the case.
Regards
Martin
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstMartin Apostolov
Hi Tayger,
One of the options for the above error is if the upload to Google Cloud Storage failed and thus the stored metadata in Kinvey points to a non-existing file in Google Cloud Storage.
Could you please confirm if the second request to Google Cloud Storage (when making a request to
_uploadURL
) succeeded?Please note that unlike private files, when uploading a public file (
_public: true
) would return not only the_uploadURL
but also_requiredHeaders
that should be included in the second request to GCS:Not including the above headers in the second request to GCS would lead to failed request/upload and thus you may end up with the described error.
Let me know if this was the case.
Regards
Martin
Tayger
Hello Martin
Thank you for the appreciated help and yes, that was it!
The additional difficulty to find the problem is the fact that the upload command does not receive any return code/status. So you don't know really whether the upload worked or not.
I remember the google cloud header was empty at the time I created the code around it. So there was not header required at that time. I have checked it now and yes, there is a google header. Thats why my public upload didn't work anymore. I just forgot about the header part.
Since that can change anytime again the header preparation should be done dynamically. From PHP/cURL perspective I post my solution here for anyone else. Since a simple JSON encode does not work here, you have to send an array:
1. Get the returned array from requesting a public file creation:
2. Prepare required header
3. Upload public file with prepared header
Thanks for your help!
Regards
-
Why am I getting "SignatureDoesNotMatch" error when uploading a file?
-
Why am I getting an "IncompleteRequestBody" error when sending a DELETE request?
-
Is there a default sort order to collections fetched without an explicit sort query?
-
Is it possible to set ACLs on all users so that only administrators can query for users (without dis
-
Flex SDK
-
Query Bug in Backend?
-
Can analytics data be retrieved via Java SDK or REST?
-
Accesing REST API from a server without a user?
-
What json is required to assign a user group either read/write?
-
LDAP Authorization
See all 120 topics