File Upload

  • Thread starter Thread starter Goncalo
  • Start date Start date
G

Goncalo

Hi.

You can limit the uploaded file size by changing the
httpRuntime's maxRequestLength in web.config, right?

So, my question is, how can you tell in CodeBehind that
the file 'uploaded' is over that size? I noticed that the
page property isPostBack is 'false'.

Thank's is advance
Goncalo
 
Hang on now. First you mention that you can limit the size of the uploaded
file, which you can, in the way you described. Then you asked if you can
determine whether or not an uploaded file is larger than that size, in your
class. Think about it. If you limit the size of the upload, it will never be
larger.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Yes. You are very true.

What I'm trying to do is to give some sort of output to
the user telling him why the file can't be uploaded.

I've noticed that if the file size is too big, the file
itself is not uploaded, but the page is submited.

Thank's in advance
goncalo
 
Well, you can check to see whether the file was uploaded or not easily
enough. No need to bother with the size.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top