No 'Access-Control-Allow-Origin' header is present on the requested resource

Hi,
I have an issue with file upload. I have the following error message:XMLHttpRequest cannot load https://api.backendless.com/<url…>. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8000’ is therefore not allowed access.
But Satus is 200, and file was uploaded successfuly. I can see it in “Files” pages.
But I have an error and can not handle success case.
Could you please help me? What am I doing wrong?

I have the sane issue when i am using code generated by Backendless for JS.

Hi Andrey!
I think answer from this topic will help you:
http://support.backendless.com/t/javascript-file-upload-async-callback-not-working

Hi Katya,

This topic did not help me. I am still having the same problem.

Backendless.Files.upload(files, TEST_FOLDER, false, callback);

I have this code in my generated file.

But it does not work.

Any other ideas?

Could you please describe your scenario/environment in greater detail? For example, where does localhost:8000 come from? What does your code look like outside of the one line you showed?

I started local server with NodeJS for SPA development. So, server is running on localhost and using :8000 port. When I make POST request I am using following url:

https://api.backendless.com/D77821BA-2D1C-09B3-FFCF-1F4D5C5D1C00/v1/files/:path/:name

Headers:

    Request URL:https://api.backendless.com/D77821BA-2D1C-09B3-FFCF-1F4D5C5D1C00/v1/files/rooms/ic_add.png Request Method:POST Status Code:200 OK Remote Address:52.1.164.167:443 Response Headersview source Cache-Control:no-cache Cache-Control:: no-store, no-cache, must-revalidate, private Cache-Control:no-cache="set-cookie" Connection:keep-alive Content-Length:104 Content-Type:application/json; charset=utf-8 Date:Sat, 12 Dec 2015 00:17:18 GMT Expires:Thu, 01 Jan 1970 00:00:01 GMT Pragma:: no-cache Server:nginx/1.4.2 Set-Cookie:AWSELB=EFE705250E930025BC0553646066CB6092AE0B3BDDCB39BA30F08C6856C1890BF29F2BA0FE986576420D64280FCA7594019D97405730C3F0FA3D504A643CBD42E7BFF898F5;PATH=/;MAX-AGE=9000 Request Headersview source Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 application-id:D77821BA-2D1C-09B3-FFCF-1F4D5C5D1C00 application-type:REST Cache-Control:no-cache Connection:keep-alive Content-Length:390 Content-Type:multipart/form-data; boundary=----WebKitFormBoundary74wNB1uU98TmPIoG Host:api.backendless.com Origin:http://localhost:8000 Pragma:no-cache Referer:http://localhost:8000/ secret-key:39B4... User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36 Request Payload ------WebKitFormBoundary74wNB1uU98TmPIoG Content-Disposition: form-data; name="file"; filename="ic_add.png" Content-Type: image/png

    ------WebKitFormBoundary74wNB1uU98TmPIoG–

Error in console:

XMLHttpRequest cannot load https://api.backendless.com/D77821BA-2D1C-09B3-FFCF-1F4D5C5D1C00/v1/files/rooms/ic_add.png. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8000’ is therefore not allowed access.

What other information do you need?

Thank you for detailed description!
We will investigate this use case on our side.

i have the same problem here, 2 months had passed. Any news?

Hi Lâm,

Looks like we dropped the ball on this. I apologize. I have scheduled an internal ticket and now this problem is being tracked.

Regards,
Mark

thanks Mark

I am also having this issue.

Hi Phil, All,

The issue has been resolved and would be fixed in next upcoming release.

Regards, Artur.

The release is scheduled for tomorrow…

Yay!

[spoiler=“still waiting for the release…”]

[/spoiler]

When you see it on our blog/twitter/facebook, you will know it is there.

Hi Andrei, Lâm, Phil

The issue has been resolved and fix is now available in production.

Regards, Artur.