Repository navigation
CORS error when uploading via S3 file adapter #722
Description
Activity
I believe the issue is what Parse is trying to solve in this thread [https://github.com/parse-community/parse-server-example/issues/53].
BTW, please show how you made it if you succeed to upload file with S3. Thanks!Fixed with #876
I'm still getting this issue when using the S3Adapter.
No 'Access-Control-Allow-Origin' header is present on the requested resource.This is only a problem when saving files, all other requests are fine.
What call are you issuing?
Client code:
var myFile = new Parse.File('photo.jpg', bytes); myFile.save().then(function() { myObject.set('image', myFile); myObject.save(); });
General:
Request URL:https://myapp.herokuapp.com/parse/classes/myClass/Ym40Fke4m5 Request Method:POST Status Code:503 Service Unavailable Remote Address:54.243.123.255:443Request headers:
Accept:*/* Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8,fr;q=0.6 Connection:keep-alive Content-Length:541 Content-Type:text/plain Host:myapp.herokuapp.com Origin:http://localhost:8000 Referer:http://localhost:8000/myPage.html User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 x-ijt:p3b2a2fs5qoldcphug0cstd1m9Response headers:
Cache-Control:no-cache, no-store Connection:keep-alive Content-Length:484 Content-Type:text/html; charset=utf-8 Date:Wed, 25 May 2016 20:49:02 GMT Server:CowboyRequest payload:
_ApplicationId: "(censored)" _ClientVersion:"js1.6.14" _InstallationId:"(censored)" _JavaScriptKey:"(censored)" _method:"PUT" (All my object attributes) [...]Error log:
XMLHttpRequest cannot load https://myapp.herokuapp.com/parse/classes/myClass/Ym40Fke4m5. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access. The response had HTTP status code 503.The file saving works.
POST https://myapp.herokuapp.com/parse/files/photo.jpggoes through and I can see the file in my S3 bucket.It's really just saving the object right after that doesn't work. Saving the same object without setting the file works.
The same request will also work fine if I run Parse Server locally.
Environment Setup
Parse Server running on AWS elastic beanstalk with configured S3 files adapter.
Steps to reproduce
Using the JS SDK from an external Website to upload an Image:
Logs/Trace
Error in chrome: