ie not support kendo upload

3 posts, 0 answers
  1. alireza
    alireza avatar
    7 posts
    Member since:
    Nov 2012

    Posted 10 Dec 2012 Link to this post

    i cannot upload with kendo upload in ie .
    ie not suport ??
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2834 posts

    Posted 11 Dec 2012 Link to this post

    Hi,

    The online demos appear to be working fine in IE9.

    What version of IE are you using and what problems are you experiencing?

    Greetings,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. alireza
    alireza avatar
    7 posts
    Member since:
    Nov 2012

    Posted 11 Dec 2012 Link to this post

    i using httphandle in asp.net
    public class uploader : IHttpHandler
       {
        
           public void ProcessRequest(HttpContext context)
           {
                
               try
               {
                   if (!string.IsNullOrEmpty(context.Request.QueryString["upload"]))
                   {
                       HttpPostedFile postedFile = context.Request.Files["kendoFile1"];
                       string filepath = context.Server.MapPath("../js");
                       string filename = postedFile.FileName;
                       if (!Directory.Exists(filepath))
                           Directory.CreateDirectory(filepath);
                       postedFile.SaveAs(Path.Combine(filepath, filename));
                       context.Response.StatusCode = (int)HttpStatusCode.OK;
                   }
                  
                   else if (!string.IsNullOrEmpty(context.Request.QueryString["remove"]))
                   {
                       string filepath = context.Server.MapPath("../test");
                       string filename = context.Request.Form["fileNames"];
                       FileInfo file = new FileInfo(Path.Combine(filepath, filename));
                       file.Delete();
                       context.Response.StatusCode = (int)HttpStatusCode.OK;
                   }
     
               }
               catch (Exception ex)
               {
                   context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
               }
           }
     
           public bool IsReusable
           {
               get
               {
                   return false;
               }
           }
       }
    when upload in mozila file uploaded but ie 7,8,9 not uploaded .
    when trace my code in mozila or ie
    give me this errorr.
    '(postedFile.InputStream).ReadTimeout' threw an exception of type 'System.InvalidOperationException'
    qustion: why top code this error ?
    i solved this problem by this code . now work fine in ie 7,8,9 and mozilla .
    public class uploader : IHttpHandler
       {
        
           public void ProcessRequest(HttpContext context)
           {
                
               try
               {
     
                   if (!string.IsNullOrEmpty(context.Request.QueryString["upload"]))
                   {
     
                       HttpPostedFile postedFile = context.Request.Files["kendoFile1"];
                      BufferedStream bs = new BufferedStream(postedFile.InputStream);
                       int length = System.Convert.ToInt32(bs.Length);
                        byte[] zipFile = new byte[length];
                         int offset = 0;
                           int remaining = length;
                           while (remaining != 0)
                           {
                               int read = bs.Read(zipFile, offset, remaining);
                               if (read <= 0)
                                   throw new EndOfStreamException(String.Format("End of stream reached with {0} bytes left to read", remaining));
                               remaining -= read;
                               offset += read;
                           }
                       string filepath = context.Server.MapPath("../test");
                       string filename = postedFile.FileName.Split('\\')[postedFile.FileName.Split('\\').Count() - 1];
                       if (!Directory.Exists(filepath))
                           Directory.CreateDirectory(filepath);
                       if (!(File.Exists(Path.Combine(filepath, filename))))
                       {
                            File.Create(Path.Combine(filepath, filename)).Close() ;
                           
                       }
                       File.WriteAllBytes(Path.Combine(filepath, filename), zipFile);
                       context.Response.StatusCode = (int)HttpStatusCode.OK;
                   }
                   else if (!string.IsNullOrEmpty(context.Request.QueryString["remove"]))
                   {
                       string filepath = context.Server.MapPath("../test");
                       string filename = context.Request.Form["fileNames"];
                       FileInfo file = new FileInfo(Path.Combine(filepath, filename));
                       file.Delete();
                       context.Response.StatusCode = (int)HttpStatusCode.OK;
                   }
     
               }
               catch (Exception ex)
               {
                   context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
               }
           }
     
           public bool IsReusable
           {
               get
               {
                   return false;
               }
           }
       }

    thanks

Back to Top