Marc
Marc

Reputation: 73

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

Upvotes: 6

Views: 1696

Answers (1)

Muhammad Akhtar
Muhammad Akhtar

Reputation: 52241

You need to increase the maxRequestLength and execution time.

<httpRuntime maxRequestLength="102400" executionTimeout="360" />

Upvotes: 5

Related Questions