Professional Web Applications Themes

Fileupload problem with files larger than 1MB - ASP.NET General

Hi I have a problem with the uploading of files larger than 1MB. My upload code look like this: If Not fUpload.PostedFile Is Nothing And fUpload.PostedFile.ContentLength > 0 Then fn = Path.GetFileName(fUpload.PostedFile.FileName) SaveLocation = Server.MapPath("hjplusupload") + "\" + fn Try fUpload.PostedFile.SaveAs(SaveLocation) lblMessages.Text = "The file has been uploaded to: " & SaveLocation Catch ex As Exception lblMessages.Text = "Error: " + ex.Message End Try Else lblMessages.Text = "Please enter a file to upload." End If And I have added the following to my web.config: <httpRuntime executionTimeout="3600" maxRequestLength="10000" /> However when I try to upload files above 1MB the server just ...

  1. #1

    Default Fileupload problem with files larger than 1MB

    Hi

    I have a problem with the uploading of files larger than 1MB.

    My upload code look like this:

    If Not fUpload.PostedFile Is Nothing And
    fUpload.PostedFile.ContentLength > 0 Then
    fn = Path.GetFileName(fUpload.PostedFile.FileName)
    SaveLocation = Server.MapPath("hjplusupload") + "\" + fn

    Try
    fUpload.PostedFile.SaveAs(SaveLocation)
    lblMessages.Text = "The file has been uploaded to: " &
    SaveLocation
    Catch ex As Exception
    lblMessages.Text = "Error: " + ex.Message
    End Try
    Else
    lblMessages.Text = "Please enter a file to upload."
    End If

    And I have added the following to my web.config:
    <httpRuntime executionTimeout="3600" maxRequestLength="10000" />

    However when I try to upload files above 1MB the server just returns a
    standard IIS "Cannot Find Server - page cannot be displayed" error -
    no error from .NET.

    I have tried adjusting the maxRequestLength - but nothing seems to
    work.
    The server is a Win2K.
    grimBeast Guest

  2. #2

    Default Re: Fileupload problem with files larger than 1MB

    The first thing you need to do is to enable IE to give you the actual error
    message:

    Tools|Internet Options|Advanced - uncheck "Show Friendly HTTP Error
    messages"

    That should help you with future error messages.

    Second, you need to make the same change in your machine.config file that
    you made in the web.config file. The settings in the machine.config file
    override any application-specific settings.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "grimBeast" <dk> wrote in message
    news:google.com... 


    Kevin Guest

  3. #3

    Default Re: Fileupload problem with files larger than 1MB

    do you have more than one machine.config?

    "Christian Bennich" <dk> wrote in message
    news:phx.gbl... 


    MS Guest

Similar Threads

  1. BUG: Flash 8 Upload problem with commons-fileupload
    By furriskey in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: December 16th, 12:50 AM
  2. Illustrator 11 files with larger than before
    By Adrian Pinderhughes in forum Adobe Illustrator Macintosh
    Replies: 1
    Last Post: May 12th, 02:37 AM
  3. #25168 [Opn->Fbk]: not able to upload files larger than 1 Mb.
    By moriyoshi@php.net in forum PHP Development
    Replies: 0
    Last Post: August 20th, 08:28 AM
  4. #25168 [NEW]: not able to upload files larger than 1 Mb.
    By anjp2003 at indiatimes dot com in forum PHP Development
    Replies: 0
    Last Post: August 20th, 08:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139