File upload questions

  • Thread starter Thread starter Tomas Vera
  • Start date Start date
T

Tomas Vera

Hello All,
I have some questions about how the file upload process works in a web app.

Background:
The user is filling out a tech support request form. On the form is a file
upload control so the user can attach a log file. On the server, when the
form is submitted, the log file needs to be attached to an email generated
by the web app using the MailMessage class.

Questions:
At what point is the file actually uploaded?
If I set a break point in the Submit_Click function, has the file already
been uploaded? If so, where is it?

Or, do I need to write my own code to read the submitted file, and store it
on the server? Any suggestions as to where to store the uploaded file?

My main concern is with security. There's no way to know what the user is
actually uploading. I'd hate to upload a virus contaminated e-mail to the
server (even though Symantec is running in the background).

Any ideas on this is appreciated.

-tomas
 
Uploading is accomplished through the use of the file browser HTML control
(input type=file). The data is contained within the documents header along
with all the other form controls. So, to answer your question, yes, the
file has been uploaded by the time the click event is invoked. The file has
no physical presence yet, you can access it through the request object
(Page.Request.Files). What you do with the data stream is up to up but you
have very limited control over what is uploaded since the client cannot open
the file and the file must be uploaded to the server to check its contents.
 
Back
Top