G
Guest
I am coding a forum and am having problems passing around the attachment file
(as an HtmlInputFile) from page to page. Sometimes the users may want to
preview their posts with the attachment specs (filesize, content-type, etc..)
before submitting.
i have tried storing it in a session like so:
HtmlInputFile uploadFile = new HtmlInputFile();
Session["ForumAttachFileContents"] = uploadFile.PostedFile;
Then retrieving it, though I can't seem to figure out if the session is
actually getting the variable because I try to cast on the next page like so
but it doesn't work:
attachmentFile = (HtmlInputFile)(Session["ForumAttachFileContents"]);
I get an error saying cast is not valid. Most forums/tutorials speak of
ways to upload, however it is not done after passing the file around. It's
simply a click and save right away process, which I do not want. Please
help, thank you.
(as an HtmlInputFile) from page to page. Sometimes the users may want to
preview their posts with the attachment specs (filesize, content-type, etc..)
before submitting.
i have tried storing it in a session like so:
HtmlInputFile uploadFile = new HtmlInputFile();
Session["ForumAttachFileContents"] = uploadFile.PostedFile;
Then retrieving it, though I can't seem to figure out if the session is
actually getting the variable because I try to cast on the next page like so
but it doesn't work:
attachmentFile = (HtmlInputFile)(Session["ForumAttachFileContents"]);
I get an error saying cast is not valid. Most forums/tutorials speak of
ways to upload, however it is not done after passing the file around. It's
simply a click and save right away process, which I do not want. Please
help, thank you.