Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uploading files greather than 4096KB fails!

I'm setting up an asp.net (asp.net framework 4.0) webproject with visual Studio 2010. In one of my webpage I use a silverlight mulit file uploader from the link below:

Silverlight Mulit File uploader

I set the max upload size from the plugin to 100 MB as you can see on the code below.

 <object id="MultiFileUploader" data="data:application/x-silverlight-2," type="application/x-silverlight-2"
    width="465" height="220">
    <param name="source" value="../ClientBin/mpost.SilverlightMultiFileUpload.xap" />
    <param name="onerror" value="onSilverlightError" />
    <param name="initParams" value="MaxFileSizeKB=102400,MaxUploads=2,FileFilter=Bilder(*.jpg *.png *.gif*)|*.jpg;*.png;*.gif|Dokumente(*.pdf)|*.pdf|Videos(*.mpeg *.avi *.wma)|*.mpeg;*.avi;*.wma|Audio(*.mp3)|*.mp3,ChunkSize=4194304,CustomParams=yourparameters,DefaultColor=White" />
    <param name="background" value="white" />
    <param name="onload" value="pluginLoaded" />
    <param name="minRuntimeVersion" value="4.0.50401.0" />
    <param name="autoUpgrade" value="true" />
    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">
        <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
            style="border-style: none" />
    </a>
</object>
<iframe style='visibility: hidden; height: 0; width: 0; border: 0px'></iframe>

I also made some entries in the web.config file:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
    </compilation>
        <httpRuntime maxRequestLength="102400" executionTimeout="360" />
    <sessionState
      mode="InProc"
      timeout="30"
      cookieless="false"
      cookieName="MMAdminPfynSession"/>
    <authentication mode="Windows"/>
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="104857600" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Everytime I upload a file bigger than 4096 KB the upload-process fails. I start my webapplication out from Visual studio 2010 while pressing ctrl-F5. Any ideas?

Greez Marc

like image 911
Marc Avatar asked May 21 '11 14:05

Marc


1 Answers

You need to increase the maxRequestLength and execution time.

<httpRuntime maxRequestLength="102400" executionTimeout="360" />
like image 105
Muhammad Akhtar Avatar answered Nov 03 '22 17:11

Muhammad Akhtar