File Upload (Tutorial Follow Along)
Hi! I'm following along with the tutorial https://docs.opensaas.sh/guides/file-uploading/ and I'm getting a 403 error after adding my IAM and S3 credentials to my .env.server
{
"message": "Request failed with status code 403",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 403\n at settle (http://localhost:3000/node_modules/.vite/deps/axios.js?v=3e43de8b:1203:12)\n at XMLHttpRequest.onloadend (http://localhost:3000/node_modules/.vite/deps/axios.js?v=3e43de8b:1420:7)\n at Axios.request (http://localhost:3000/node_modules/.vite/deps/axios.js?v=3e43de8b:1780:41)\n at async handleUpload (http://localhost:3000/@fs/home/jparker/my_apps/sass_one/advertiser/app/src/client/app/FileUploadPage.tsx:62:19)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "image/jpeg"
},
"method": "put",
"url": "https://hereqr1.s3.us-east-2.amazonaws.com/2/6b13aab3-114d-4b7f-ab0b-640b2899204f.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=[REDACTED]%2F20240524%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240524T024414Z&X-Amz-Expires=3600&X-Amz-Signature=77f03e27f916b8e19612cb1d535b69a3c92b6a084de0f283d0ebfa401f34bdcf&X-Amz-SignedHeaders=host&x-id=PutObject",
"data": {}
},
"code": "ERR_BAD_REQUEST",
"status": 403
}{
"message": "Request failed with status code 403",
"name": "AxiosError",
"stack": "AxiosError: Request failed with status code 403\n at settle (http://localhost:3000/node_modules/.vite/deps/axios.js?v=3e43de8b:1203:12)\n at XMLHttpRequest.onloadend (http://localhost:3000/node_modules/.vite/deps/axios.js?v=3e43de8b:1420:7)\n at Axios.request (http://localhost:3000/node_modules/.vite/deps/axios.js?v=3e43de8b:1780:41)\n at async handleUpload (http://localhost:3000/@fs/home/jparker/my_apps/sass_one/advertiser/app/src/client/app/FileUploadPage.tsx:62:19)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "image/jpeg"
},
"method": "put",
"url": "https://hereqr1.s3.us-east-2.amazonaws.com/2/6b13aab3-114d-4b7f-ab0b-640b2899204f.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=[REDACTED]%2F20240524%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240524T024414Z&X-Amz-Expires=3600&X-Amz-Signature=77f03e27f916b8e19612cb1d535b69a3c92b6a084de0f283d0ebfa401f34bdcf&X-Amz-SignedHeaders=host&x-id=PutObject",
"data": {}
},
"code": "ERR_BAD_REQUEST",
"status": 403
}