Click here to Skip to main content
15,888,170 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
  $("#<%=FileUpload1.ClientID%>").fileUpload({
            'uploader': 'scripts/uploader.swf',
            'cancelImg': 'images/cancel_upload.png',
            'buttonText': 'Browse Files',
            'script': 'Upload.ashx',
            'folder': 'uploads',
            'queueSizeLimit': '2',
            'fileDesc': 'Image Files',
            'fileExt': '*.jpg;*.jpeg;*.gif;*.png;*.doc;*.docx;*.pdf;*.txt;*.bmp;*.ppt;*.pptx',
            'multi': true,
            'auto': false,
          
          
            'onAllComplete': function () {
                 
               $find('NewFileUploadModalPopupExtender').hide();
                $(document).ready(function () {
                    $('#ContentPlaceHolder1_ImageButton4').trigger('click');
                });
            },
           
);
 public class Upload : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
 if (HttpContext.Current.Session["strFilepath"] != null && HttpContext.Current.Session["strParentID"] != null)
            {
                //objError.WriteLog(HttpContext.Current.Session["strHandlerParentID"].ToString(), HttpContext.Current.Session["strHandlerParentID"].ToString(), Path.GetFileName(context.Request.Url.AbsolutePath));
                HttpFileCollection fileCollection = context.Request.Files;
                if (context.Request.Files.Count > 0)
                {
                    string filepath = HttpContext.Current.Session["strFilepath"] as string;
                    string parentid = HttpContext.Current.Session["strParentID"] as string;
                    // get the applications path 
                    for (int j = 0; j <= context.Request.Files.Count - 1; j++)
                    {
                        HttpPostedFile uploadFile = context.Request.Files[j];
                        TUIPortal.Core.ImageUtilities objNew = new TUIPortal.Core.ImageUtilities();
                        if ((CheckFileExtension(System.IO.Path.GetExtension(uploadFile.FileName)) == true) && CheckMaximumFileSize(uploadFile.ContentLength) == true)
                        {
                            string strFileName = objNew.DoUpload(uploadFile, filepath, int.Parse(parentid));
                           
                            
                        }
                    }
                }}
Hi here i am using this code for file uploading but handler page doesn't not return session value only firefox. IE and Chrome working perfect i got solution but webconfig file
HTML
<sessionstate timeout="20" cookieless="true"></sessionstate>

i include cookieless working fine but session id displaying url how to solve this issues any one help me
Posted
Updated 24-Feb-14 20:09pm
v2

Follow webcode expect

http://www.webcodeexpert.com/[^]
 
Share this answer
 
Comments
satheeshkumar chinnadurai 25-Feb-14 23:57pm    
i have implemented IRequiresSessionState interface in the handler. Still the error "object referance not set to an instant of an object " persists

I already tried this way but it did not work for me. :(
in temp.aspx file i assigned value to session:
Context.Session["temp"] = _idalbum;
and in .ashx file i tried this:
string allfolder = context.Session["temp"].ToString();
which caused error -object referance not set to an instant of an object because session is null.
Sai Prasad anumolu 26-Feb-14 0:02am    
Context.Session["temp.aspx"] = _idalbum;
string allfolder = context.Session["temp.aspx"].ToString();
you can try this
Hi,
Quote:
i include cookieless working fine but session id displaying url how to solve this issues any one help me

for this you can use routing or url rewriting for this for hiding query string in url.you can use custom url by your own by this technique.
URL Routing in ASP.NET 4.0 Web Forms[^]
 
Share this answer
 
Comments
satheeshkumar chinnadurai 25-Feb-14 23:58pm    
give any other option plz

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900