Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 20th, 2012  |  syntax: None  |  size: 2.05 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. IIS7 refuses chunked-encoded file upload
  2. <html>
  3.   <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
  5.   </head>
  6.   <body>
  7.     <form method="post" enctype="multipart/form-data">
  8.       File: <input type="file" name="upfile" />
  9.       <input type="submit" value="go"/>
  10.   </form>
  11.   </body>
  12. </html>
  13.        
  14. curl.exe http://serveur/test.php --form "upfile=@text.txt"
  15.    -H "Transfer-Encoding: chunked" -H "Expect:"
  16.        
  17. POST http://serveur/test.php HTTP/1.1
  18. User-Agent: curl/7.15.3 (i586-pc-mingw32msvc) libcurl/7.15.3 zlib/1.2.2
  19. Host: serveur
  20. Pragma: no-cache
  21. Accept: */*
  22. Connection: Keep-Alive
  23. Transfer-Encoding: chunked
  24. Content-Type: multipart/form-data; boundary=----------------------------310dbcc6761b
  25.  
  26. 8c
  27. ------------------------------310dbcc6761b
  28. Content-Disposition: form-data; name="upfile"; filename="text.txt"
  29. Content-Type: text/plain
  30.  
  31.  
  32. 5
  33. hello
  34. 30
  35.  
  36. ------------------------------310dbcc6761b--
  37.  
  38. 0
  39.        
  40. POST http://serveur/test.php HTTP/1.1
  41. User-Agent: curl/7.15.3 (i586-pc-mingw32msvc) libcurl/7.15.3 zlib/1.2.2
  42. Host: serveur
  43. Pragma: no-cache
  44. Accept: */*
  45. Connection: Keep-Alive
  46. Content-Length: 193
  47. Content-Type: multipart/form-data; boundary=----------------------------e2d761bc173a
  48.  
  49. ------------------------------e2d761bc173a
  50. Content-Disposition: form-data; name="upfile"; filename="text.txt"
  51. Content-Type: text/plain
  52.  
  53. hello
  54. ------------------------------e2d761bc173a--
  55.        
  56. HTTP/1.1 200 OK
  57. Content-Type: text/html
  58. Server: Microsoft-IIS/7.5
  59. X-Powered-By: PHP/5.3.8
  60. X-Powered-By: ASP.NET
  61. Date: Mon, 21 Nov 2011 10:47:57 GMT
  62. Content-Length: 272
  63.  
  64. <html>
  65. <head>
  66.   <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
  67. </head>
  68. <body>
  69.   <form method="post" enctype="multipart/form-data">
  70.     File: <input type="file" name="upfile" />
  71.     <input type="submit" value="go"/>
  72.   </form>
  73. </body>
  74. </html>
  75.        
  76. C:...inetsrv>appcmd.exe set config /section:asp /enableChunkedEncoding:True
  77. Applied configuration changes to section "system.webServer/asp" for "MACHINE/
  78. WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
  79.        
  80. 5
  81. hello
  82.        
  83. 5
  84. h ello