Click here to Skip to main content
15,896,290 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I am uploading larger file size more then 2 GB, where i could not debug my code, where if the file size is less then 2 GB then it is working properly.

My Web Config File :-

<httpruntime targetframework="4.5" maxrequestlength="4194304" executiontimeout="18000" requestlengthdiskthreshold="9172">

XML
<requestLimits maxAllowedContentLength="4294967295"/>


IIS is :- IIS7

For this i could not recognize the problem.

What I have tried:

I have changed the maxRequesrLength value.
Posted
Updated 22-Nov-16 23:34pm
Comments
Afzaal Ahmad Zeeshan 23-Nov-16 6:14am    
Despite the answers it does not make much sense. If you are allowing large files to be uploaded, use a service; or create one. You may allow users to submit small files from web interface then provide them with a service endpoint with a desktop application to upload large blobs.

This goes in the web.config file. The value specified is the number of kilobytes.

XML
<configuration>
  <system.web>
    <httpRuntime maxRequestLength="xxx" />
  </system.web>
</configuration>
 
Share this answer
 
v2
Comments
Member 12352638 23-Nov-16 3:54am    
I have define maxRequestLength as

maxrequestlength="4194304"
Hi,

if you are using IIS7 then u need to define request Limits also. Here I have declared values for 15MB file upload.

Try this !

XML
<system.web>
   <!-- maxRequestLength,need to add in KB (15 * 1024) --> 
   <httpRuntime maxRequestLength="15360" ></httpRuntime> 
</system.web>

<system.webServer>              
   <security> 
      <requestFiltering> 
         <!-- maxAllowedContentLength, for IIS, in bytes (15 * 1024 * 1024) --> 
         <requestLimits maxAllowedContentLength="15728640" ></requestLimits>
      </requestFiltering> 
   </security>
</system.webServer>
 
Share this answer
 
Comments
Member 12352638 23-Nov-16 3:54am    
I have define maxRequestLength as

maxrequestlength="4194304"
preety sunita 23-Nov-16 5:13am    
ok.so try above modification in your webconfig for 4MB file size.
maxRequestLength need to define in KB (which is you are giving in bytes 4 * 1024 *1024 ) and for IIS7 requestfiltering is required so maxAllowedContentLength need to add in bytes.

Let me know any help you require!
Quote:
I am uploading larger file size more then 2 GB,
What ? are you loading some web pages of size up to 2GB ?
And the whole page is useful to user ? And he don't get bored to wait half an hour to get the page ?
What is in the page ? Phone numbers of the whole country ?

If you organize your page in smaller chunks, you will have the side effects of reducing the workload on server and the page will be more responsive on user side.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900