I have my webUpload control set up in a webForm. It works to the extend that it uploads a file and saves it in my 'Uploads' directory. But the problem is that I need the session available from HttpContext.Current.Session to be able do what I want with the file. It is evaluating as null and I don't understand why.
Hey Lenny,
It is normal that HttpContext.Current.Session is not available because HttpContext always relates to the current request.
HttpContext
Thanks,
Miro Hristov
My mistake the session is available as Session[key] but not available here:
HttpContext.Current.Session
Sorry for any confusion.
Hello Lenny,
Did you have a chance to try this. We tested it on our end and it works in all the cases.
Looking forward to hear from you.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
That is not going to work. The reason there is no session state available is that the upload controls events are raised from an object that implements IHttpModule. Session is not available in an HttpModule.
Hey chadc,
I can propose you workaround to use session in server side events you can just set in Page_Load var session = this.Page.Session. Please try this. Here are my comments for your proposals.
1) The main idea for upload directory is to have only ONE temporary folder where files are saved and then using server side events to save them anywhere you want or to do with the files what you want. But we have discussed this and we think to implement each control to be configurable to have separate folder. I hope we will implement this for the next Service Release.
2) We plan to implement saving files in memory stream(or byte array) for the next SR.
3) As I said one workaround is to play with your session in page_load. For instance to set var session = this.Page.Session in your Page_Load event handler.