3. Implementation/WCF

upload and download over 30 MB file between silverlight and wcf service

SSKK 2014. 4. 29. 02:39

Recently My project members and I are suffering from the problem that cannot upload and download over 30 MB file between silverlight and wcf service.


I googled lots of things and applied the suggestions but anything did not resolve our issue.


With this trouble remained I cannot sleep well so I'm writing this article now.


I searched more webs to find any hint to help us. Following sites can be helpful but the result will be known tomorrow.


http://ajaxuploader.com/large-file-upload-iis-debug.htm


This site suggests very good guide lines as below: 


1. Required

IIS7 - maxAllowedContentLength

IIS6 - maxRequestLength


2. Microsoft URL Scan

C:\WINDOWS\system32\inetsrv\urlscan\UrlScan.ini

MaxAllowedContentLength


3. File upload debug file


debug-upload.zip



http://ajaxuploader.com/large-file-upload-iis-asp-net.htm


This sites shows the required configuration for IIS7


1. Modify the maxAllowedContentLength setting in the web.config


<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="2147483648" />
    </requestFiltering>
  </security>

</system.webServer> 


=> 2147483648 - 2 GB in size

2. Edit the request filtering feature settings and the request limits using IIS manager

  • Open IIS Manager.
  • Select the website that you want to configure.
  • Make sure you are in Features View per the button at the bottom of the manager.
  • Select Requests Filtering and open it by double-clicking the icon. The Request Filtering pane displays.
  • From the Actions pane on the right hand side of the screen click Edit Feature Settings... link. The Edit Request Filtering Settings window displays.
  • In the Request Limits section, enter the appropriate Maximum allowed content length (Bytes) and then click the OK button.
  • Restart IIS.


3. Manually edit the ApplicationHost.config file



  • Click Start. In the Start Search box, type Notepad. Right-click Notepad, and then click Run as administrator.
  • On the File menu, click Open. In the File name box, type %windir%\system32\inetsrv\config\applicationhost.config, and then click Open.
  • In the ApplicationHost.config file, locate the <requestLimits> node.
  • Remove the maxAllowedContentLength property. Or, add a value that matches the size of the Content-Length header that the client sends as part of the request. By default, the value of the maxAllowedContentLength property is 30000000. 

    For example, modify the following configuration data inside the <requestFiltering> section.

    <requestLimits maxAllowedContentLength ="<length>" />
  • Save the ApplicationHost.config file.


Finally to resolve this, we developed upload/download feature with new way: duplex communication on download and upload partitioning.


But this information is worth keeping in mind.