1

When uploading files to a server and calling a controller method does a HttpPostedFileBase contain the entire file or just information such as name, path, etc?

What I want to know is if the file is uploaded to the server right away or not until calling SaveAs(path) ?

tereško
  • 58,060
  • 25
  • 98
  • 150
Mihai Bratulescu
  • 1,915
  • 3
  • 27
  • 43

1 Answers1

4

As the file is part of your request, it is uploaded immediatly. It is just buffered into a tempfile which the system will delete once you send the Response.

If you use SaveAs, you just transfert the file into a permanent location.

artragis
  • 3,677
  • 1
  • 18
  • 30