File Upload "Page Cannot Be Displayed"

Last post 04-18-2007 8:19 AM by jingles. 3 replies.

Sort Posts:

  • File Upload "Page Cannot Be Displayed"

    04-18-2007, 7:38 AM
    • Member
      17 point Member
    • jingles
    • Member since 01-20-2007, 8:33 AM
    • Posts 22

    Hi,

    This problem has been driving me crazy... I'm trying to write a page that allows people to upload mp3 files to a directory.

    I have successfully written a page that allows people to do the same with images, but when I upload mp3 files that are larger than about 4mb (I think), on clicking the "upload" button, the page times out without any evidence of attempting the operation.

    Just to make sure I tried this on a new website, with a completely blank page aside from one fileupload control, one button and no code behind the page. When browse to any filetype over about 4mb and click the button, the page times out and displays "This Page Cannot Be Displayed" almost instantly. Why is it?

    Is there a size limit on the files you can upload? Any help with this would be greatly appreciated. 

  • Re: File Upload "Page Cannot Be Displayed"

    04-18-2007, 8:00 AM
    • All-Star
      37,391 point All-Star
    • Haissam
    • Member since 10-05-2006, 6:25 AM
    • Beirut - Lebanon
    • Posts 5,632

    ASP.NET sets the default request length to 4 mb. to fix this you have to modify the web.config file as below

    <httpRuntime maxRequestLength="100000"/>

    The value of maxrequestlength is in KB. in this case it's allowed up to 100 MB

    HC

    Haissam Abdul Malak
    MCAD.NET
    | Blog |
  • Re: File Upload "Page Cannot Be Displayed"

    04-18-2007, 8:06 AM
    • Contributor
      2,240 point Contributor
    • Ramzi.Aynati
    • Member since 03-01-2007, 9:22 AM
    • Lebanon
    • Posts 531

    Dear Jingles

    Its normal

    The max upload file for asp.net applications is exactly 4 mb

    To increase the max upload file add this to ur web.config

    <httpruntime maxrequestlength="10240">  (10 mb) u can increase it as u want

    Hope this works fine for u

    Cheers

    Regards
    Ramzi
    --------------------------------------------
    Dont Forget to mark the post as answered once replied.
  • Re: File Upload &quot;Page Cannot Be Displayed&quot;

    04-18-2007, 8:19 AM
    Answer
    • Member
      17 point Member
    • jingles
    • Member since 01-20-2007, 8:33 AM
    • Posts 22

    Thanks guys,

    I feel a bit now because I found this just after I made the post.

     

    Thanks for the responses though!

    Steve 

Page 1 of 1 (4 items)