After generating keys for my Google Cloud Storage bucket, I can see my files in the web UI at https://dashboard.groupdocs.cloud/files
. I am however unable to upload files via the web UI as well as using merger_cloud.UploadFileRequest() (nodejs SDK), which acts as it has been succesfully executed, but has in fact not been. Downloading via the web UI and merger_cloud.DownloadFileRequest() works. Uploading to Internal Storage or Google Drive does work with the same code, as does uploading via the web UI. Could you assist me with this issue so I can upload files to Google Cloud Storage using UploadFileRequest()? Thank you.
Please specify the file path along with the folder(container) name and let us know if you still face any issues.
Using the full file path I am still having the same problem. I tried using node.js and Python SDK and get the following result:
File upload result: {‘errors’: [{‘code’: ‘error’,
‘description’: 'Operation Failed. An error occurred while sending ’
‘the request.’,
‘inner_error’: {‘date’: datetime.datetime(2021, 10, 11, 17, 8, 51, 933652, tzinfo=tzutc()),
‘request_id’: ‘5fc6ccad-40d6-47ce-a46a-874c1fc90dfb’},
‘message’: 'Google Cloud Storage exception: Error while ’
‘downloading file. One or more errors occurred.’}],
‘uploaded’: []}
I encounter this error with several file paths:
upload_file(’./pptpdf.pdf’, ‘gs://test-bucket-963258/test/pptpdf.pdf’)
upload_file(’./pptpdf.pdf’, ‘./test-bucket-963258/test/pptpdf.pdf’)
upload_file(’./pptpdf.pdf’, ‘/test-bucket-963258/test/pptpdf.pdf’)
upload_file(’./pptpdf.pdf’, ‘test-bucket-963258/test/pptpdf.pdf’)
upload_file(’./pptpdf.pdf’, ‘./test/pptpdf.pdf’)
Here is my Python code for this function:
def upload_file(local_file_path, remote_file_path):
request_upload = groupdocs_merger_cloud.UploadFileRequest(remote_file_path, local_file_path)
response_upload = file_api.upload_file(request_upload)
print("File upload result: " + str(response_upload))
When I look at my API usage logs, I get that my request was succesful image.png (25.9 KB).
Thanks.
If you have not set your Google Cloud Storage as default storage in the application setting of https://dashboard.groupdocs.cloud then you need to pass the storage name in the UploadFileRequest. Otherwise, please share your credentials along with the storage name in a private message. For the private message, click on my user icon and opt the message tab with the required information. Kindly remove “RE:” from the title as well.
Thanks for your help.
My upload issue is fixed by regenerating my Access and Refresh tokens in https://dashboard.groupdocs.cloud/storages/googlecloud/edit/
and saving these settings. This error pops up a few times a day though, so I have to do this quite often. Could this be fixed?
There should not be an issue with the configuration. Please share the sample code and documents along with the credentials once you face this issue again. We will investigate the issue.
P.S: Share credentials as a private message.