Problem uploading using S3 file upload

If you choose DigitalOcean or Lineode, you can specify the region:

image
… but this region, as well as the default ‘us-east-1’ appear in the error message:

image

(but I’m not clear about the significance of this).

Try changing the credential url parameter string(us-east-1) and change it for the linode region(eu-central-1) and send it manually and see what you get(hopefully a 2xx response)

Thanks - but the request was again blocked because of CORS.

It would be good to hear from anybody who has successfully managed to upload files to DigitalOcean or Lineode.

I’m not sure if should keep trying with this, perhaps with other providers, or if there is a problem and I should just wait until there is a fix. I would prefer to use DigitalOcean if possible.

I have several tests with Digital Ocean and never had any problems uploading files. Check the response headers from the server, it is definitive a CORS issue.

Thanks. I’ll try again.

I’ve had another look at this and have new information. I thought I had tried this before, but perhaps with the wrong combination of other settings. In any case…

The upload works fine if ‘Single’ is selected; it fails with errors (as mentioned above) if ‘Multi’ is selected:
image

Doesn’t this mean it can’t be CORS related? I would have thought this would suggest it’s a Wappler issue, unless there are some extra settings I should make in the case of multiple file upoad, apart from choosing ‘Multi’ in the S3 upload component in App Connect.

Tested it with the multi upload and works fine for me. What are the requests shown in the network tab of devtools? It should show 3 requests for each file being uploaded, 1st request is to the api to request the signed url, the other 2 requests are for the upload to digital ocean, 1 request is 0 bytes and is the CORS check to see if request is allowed and the other is the actual upload (PUT).

I created a file including nothing but the S3 uploader, using the single upload option. This gives the results you describe:

I duplicated the file and made just one change: I selected the multi-file option. This results in:

The three requests are repeated and then this appears:

image

This happens every time. I’ve tried with various settings at the Digital Ocean end. Here are some of the headers, including the 403:

image

Doesn’t look like it is a CORS problem, the GET request is to the API to get the signed URL, the OPTIONS request is the CORS check and is successful, the PUT request is the actual upload and that fails.

A 403 status code means that credentials are incorrect, where do you get the 403 response?

The 403 responses are returned with each PUT. It’s clearer using Firefox:

image

The XHR message shows:
<?xml version="1.0" encoding="UTF-8"?><Error><Code>SignatureDoesNotMatch</Code><RequestId>tx0000000000000c22edab2-005fcf6f1c-2c41755-ams3b</RequestId><HostId>2c41755-ams3b-ams3-zg02</HostId></Error>

Apart from the selection of single or multi, everything else is exactly the same, so the credentials should be valid in each case.

A post was split to a new topic: S3 upload invalid path error

I’ve still made no progress with this. I would be interested to hear from anyone who has had success uploading to Digital Ocean - using the multiple file option - to help point me in the right direction.

Patrick suggested the credentials might be incorrect, which would seem the most likely cause. However, given I have no problem using uploading a single file, using the same server action, I would have thought the credentials must be correct.

I would be very grateful for any suggestions. I would really like to be able to use this feature.

Problem in your last error message is that the signature doesn’t match. That can have a lot of reasons. Most common reason is an invalid/expired api key is used, you could generate a new api key and test it with that one. An other problem is that the signature expires, set expire time higher and check if the time is setup correctly on the server, if the server doesn’t have the correct time then it generates an incorrect signature.

Thanks for your continuing help with this. If I have a file using the Single option, it works fine. If I change Single to Double - and make no other changes - the signature not matching error appears. There is also a ‘Cors Missing Allow Origin’ error. Doesn’t this mean neither the api key nor expire time can be the problem? ie:

With this setting it works:

image

If I simply change this (ie same server action etc), it fails:

image

Is there something I’m missing? Is there something I should be changing in the api/server action file? You mentioned increasing the expire time and I changed this:

image

Is that what you meant? (It didn’t seem to make any difference.)

It’s been a bit of wait - but the multi-file upload feature works really well now. Thanks.

This has been fixed in Wappler 4.7.2

This topic was automatically closed after 42 hours. New replies are no longer allowed.