5 pts.
 Reading content of a file uploaded by user
Hi everyone, new user here. I've been finding it harder and harder to get answers at EE for certain questions, and am hoping someone here will be able to help me! Using asp.net and c#, my site allows users to save the innerhtml of a certain div to a file. Now I need the reverse. Here's what I need: upon clicking a button, the user gets a "open file" dialog, which let him choose a file on his pc. Upon choosing it, the site reads the content of the file, and assigns it as the innerhtml of a div. several points: 1) can this be done without saving the file to the server? I have no need for the actual file, just the contents of it. 2) I would ideally want the file to have a proprietary file extension, so the user doesnt by mistake upload a wrong file. I've been saving the file using Response.ClearHeaders(); Response.ClearContent(); Response.AddHeader("content-type", "text/plain"); Response.AddHeader("Content-disposition", "attachment; filename=yourname.txt"); Response.Write(divTest.InnerHtml); Response.Flush(); Response.End(); Can I use this for a proprietary file.extension? 3) Should I be worried about hacking? I.e. can someone put malicious code in the file which, upon loaded as the innerhtml of the div, will cause me havoc? TIA!

Software/Hardware used:
ASKED: June 30, 2009  9:03 PM
UPDATED: June 30, 2009  9:23 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _