I'm trying to set up the S3 file upload to DigitalOcean Spaces. I haven't used this feature before and I'm probably doing something wrong.
I can list buckets and files etc. so I think the settings are essentially correct. I've added the CORS settings according to the docs. What might be wrong are the settings I used in the 'S3 sign upload template' step. As far as I can see, the S3 Provider Properties should be the same as the settings already entered in Globals > S3 Storage - so I wouldn't expect to have to enter them again. If different values should be entered, what should they be?
If I run the server connect/api file itself, I get:
"message": "Found 2 errors while validating the input provided for the PutObject operation:\n[Key] is missing and is a required parameter\n[Key] expected string length to be >= 1, but found string length of 0",<
If I select a file to upload, and click the upload button, the upload starts (progress bar moves etc), but then it fails. After some retries 'Network error, perhaps no CORS set' appears. the request URL includes sha256=UNSIGNED-PAYLOAD.
There have been some changes with the new version (3.5.6). It seemed odd that it was necessary to repeat the details already entered into the S3 Storage Glocal. This issue seems to have been fixed. However I still can’t get it to work.
Now, having selected files to upload, a message appears - ‘Ready to Upload’ (this didn’t appear before). Then, after clicking the upload button, this appears:
After the upgrade, the template now creates steps like this:
Are the steps in the wrong order? I tried reording them but that didn’t help.
I might well be doing something wrong but I can’t get it to work. Any suggestions would be much appreciated.
Seems that the template is indeed in the wrong order (reversed). You only need the Sign Upload Url step if you have the S3 Provider globally, just change the name to url.
If you directly use a Service it should be generated for you, so that should be fine. Remove the S3 Provider step in the sign upload action file, check the Sign Download Url step if it points to the correct provider.
I removed the step and this time it seemed to work - but unfortunately it didn’t. There was a delay and the progress bar updated, and after a little delay:
Opening the server connect file in a browser:
“message”: “Found 2 errors while validating the input provided for the PutObject operation:\n[Key] is missing and is a required parameter\n[Key] expected string length to be >= 1, but found string length of 0”,
Calling the server parameter doesn’t give any errors but it doesn’t work. (Wouldn’t it need the whole path to know which file to upload?). It returns this:
The X-Amz-Content-Sha256=UNSIGNED-PAYLOAD is that it has no hash to validate the data integrity. The region us-east-1 is the default, it isn’t used by Digital Ocean and it I have tested it and it didn’t matter.
The url looks fine, what fails is the actual upload from the client. Does the network tab of devtools show anything, connection being disconnected or error?
I’ve just set up an account with Lineode. I thought it might be a problem with DigitalOcean but I have the same problem. Again, I’ve checked the account details by listing buckets etc. without any problem.
The console errors include: Access to XMLHttpRequest... has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I tried with CORs enabled and disabled (an option on Lineode).
This last error could actually be related to the region. Some Object Storage providers don’t take into account the region(like DO) in the credential url parameter but others do(like scaleway). It might be the case for linode.