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.AddHeader("Content-disposition", "attachment; filename=yourname.txt");
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?
June 30, 2009 9:03 PM
June 30, 2009 9:23 PM