Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to upload a file (which can be quite large) from the website of one server to the backend of another server using plupload. Lets say:

domain 1 =
domain 2 =

Trying to upload i send the following:

OPTIONS /main/uploadnetwork.php HTTP/1.1
Connection: keep-alive
Access-Control-Request-Method: POST
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
Access-Control-Request-Headers: origin, content-type
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
DNT: 1

But when I try to start the upload the server returns the following:

HTTP/1.1 405 Method Not Allowed
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
X-Powered-By-Plesk: PleskWin
Date: Mon, 01 Oct 2012 12:41:57 GMT
Content-Length: 999

After doing some research I found out that a browser does this to check if the server will accept the intended message. It looks like my server doesn't feel like accepting a simple POST call even tho i use post all the time.

The Google Chrome console gives the following error:

XMLHttpRequest cannot load Origin is not allowed by Access-Control-Allow-Origin.

Does anyone know how to stop the browser from checking or how i can tell my server to just accept the POST?

share|improve this question

The browser is probably not allowing cross site connections. Check this site for workaround on the destination server:

share|improve this answer
up vote 0 down vote accepted

I found out that IIS 7.5 requires you to specify which domains are allowed to POST to the backend (see documentation). Basically I needed to add the following to the web.config file:

       <add name="Access-Control-Allow-Origin" value="*" />

With this all problems were solved!

share|improve this answer

I see you are using IIS. It also seems the URL you're trying to access to consume your web service is according to Chrome console (although is confuses me a bit that in the request headers you are posting when you try to upload there is an OPTIONS /main/uploadnetwork.php HTTP/1.1 - probably because you edited the info to hide the real address).

I encountered the same problem and the answer may be simpler than those above if your case is calling an URL without a explicit "somewhat.php" document at the end. If you are sure the address of the service is (http and all removed due to not having "enough reputation") and there is a default document being served there (I assume it is index.php), you have to append a trailing slash at the end of your address to call it.

So call the service at this address:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.