Search code examples
uploadcare

In uploadcare, I'm getting an empty 403 error when using the upload POST endpoint


I'm using a raw post since I'm using react native and I didn't see a react-native library.

I'm getting a 403 response when trying to upload using the raw upload form post- is there a setting that I need to set or is my public key not activated or something? I don't see a text response in the 403 response so not sure what the specific error is.

Here's my sample CURL from postman

curl -X POST -H "Content-Type: multipart/form-data; boundary=..." 
-F "UPLOADCARE_PUB_KEY=foo" 
-F "UPLOADCARE_STORE=1" 
-F "[email protected]" "https://upload.uploadcare.com/base/"

Solution

  • Here are few things you should look at:

    1. content-type is not needed here
    2. reason for 4xx should be stated in response body or headers
    3. make sure that you don't have typos in API key
    4. make sure that automatic storing is enabled in the project or send "UPLOADCARE_STORE=auto"
    5. make sure that your account is not blocked, has some quota left, file type is allowed, etc.
    6. don't rely on Postman, check the command with cURL

    This works:

    curl -vv -X POST \ -F "UPLOADCARE_PUB_KEY=demopublickey" \ -F "UPLOADCARE_STORE=1" \ -F "[email protected]" "https://upload.uploadcare.com/