1

I am trying to use DropZone (www.dropzonejs.com/) to post an xlsx file to read on the client side. This works in my test environment using ember server. However, once I brought it across to IIS8, I am getting a 405 Method Not Allowed error. DropZone makes a POST request with the file. I tried adding the POST verb to the StaticFile Handler Mapping but it does not seem to affect it. I was wondering if it could be to do with the Origin not having a trailing slash, while the Referer does.

The StaticFile Handler Mapping in IIS for the Site has a Path of * and Verbs is set to "All Verbs", Access is "Read", Mapping is "File or Folder"

This is what I can see using Chrome Developer Tools:

POST http://<my site URL>/# 405 Method Not Allowed 28ms

General

Remote Address:<my server ip>:80
Request URL:http://<my site url>/
Request Method:POST
Status Code:405 Method Not Allowed

Resonse Headers

Access-Control-Allow-Headers:Accept, Content-Type, Origin
Access-Control-Allow-Methods:GET, PUT, POST, DELETE, OPTIONS
Access-Control-Allow-Origin:*
Allow:GET, HEAD, OPTIONS, TRACE
Cache-Control:private
Content-Length:5291
Content-Type:text/html; charset=utf-8
Date:Thu, 10 Sep 2015 23:20:03 GMT
Server:Microsoft-IIS/8.0
X-Powered-By:ASP.NET

Request Headers

Accept:application/json
Accept-Encoding:gzip, deflate
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Content-Length:252016
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryJMRgHAltxqUm8aBL
Host:labeleditorclient
Origin:http://<my site URL>
Referer:http://<my site URL>/
User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
X-Requested-With:XMLHttpRequest

Request Payload

------WebKitFormBoundaryJMRgHAltxqUm8aBL
Content-Disposition: form-data; name="file"; filename="1.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


------WebKitFormBoundaryJMRgHAltxqUm8aBL--
Asagohan
  • 127
  • 1
  • 1
  • 7

1 Answers1

0

I found out what the issue was. The default page was index.html. There was no handler for html that handled POST.

So I followed the instructions here to add a handler for html http://sysadmin.circularvale.com/server-config/enabling-post-requests-to-static-eg-html-pages-using-iis-7/

After that, it worked.

Asagohan
  • 127
  • 1
  • 1
  • 7