File Uploaded in Directory but Status Error

2 posts, 0 answers
  1. Julius
    Julius avatar
    3 posts
    Member since:
    Jun 2014

    Posted 25 Jun 2014 Link to this post

     File upload already in the directory but my status is Error Can anybody help me, thanks in advance..

     Here's my sample Code

    /////////// kendo_upload.aspx /////////////////////////////////////////////////////////////

             $("#uploaded").kendoUpload({

                    async: {
                        saveUrl:"kendo_upload.aspx",
                        removeUrl:"remove",
                        autoUpload: true
                    },
                    onSuccess: onSuccess,
                    error: onError

                });

    /////////////// kendo_upload.aspx.cs /////////////////////////////////////////////////////////////////////////////

    protected void Page_Load(object sender, EventArgs e)
            {
                ProcessRequest();

            }

            public void ProcessRequest()
            {

                Response.Expires = 1;
                try
                {
                    HttpPostedFile file = Request.Files["uploaded"];

                    if (file != null)
                    {

                        string savepath = Server.MapPath("~/UploadFiles/");
                        string filename = file.FileName;
                        file.SaveAs(savepath + filename);
                        Response.ContentType = "application/json";
                        Context.Response.Write("{}");

                    }


                }

                catch (Exception ex)
                {
                    Response.Write(ex.ToString());
                }
            
            }







  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 27 Jun 2014 Link to this post

    Hello Julius,

    I posted reply in the other thread you opened. Try  to return empty string like explained in the docs here:

    http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/upload/overview

    Kind Regards,
    Petur Subev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top