Uploading a file and limiting the size of the file.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mufasa

    Uploading a file and limiting the size of the file.

    I am using the file upload control and want to limit the size of the file
    that is uploaded. But it appears as if it actually uploads the file and then
    does the check. Is that true?

    Ideally I'd like to have it give me the results back before it uploads the
    file so it doesn't need to waste all that time.

    TIA - Jeff.


  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Uploading a file and limiting the size of the file.

    On Apr 10, 12:53 pm, "Mufasa" <j...@nowhere.c omwrote:
    I am using the file upload control and want to limit the size of the file
    that is uploaded. But it appears as if it actually uploads the file and then
    does the check. Is that true?
    >
    Ideally I'd like to have it give me the results back before it uploads the
    file so it doesn't need to waste all that time.
    >
    TIA - Jeff.
    Hi,

    Honestly I do not know of any form to knownig "in advance" the size of
    the file.
    You could post in the ASPNET NG to see if you get a more detailed
    answer

    Comment

    • Marc Gravell

      #3
      Re: Uploading a file and limiting the size of the file.

      Well, you can check the incoming content-length header quite early,
      but it might be sending it without this header, in which case you'd
      need to abort while reading.

      Marc

      Comment

      Working...