This is a migrated thread and some comments may be shown as answers.

File Uploaded in Directory but Status Error

1 Answer 34 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Julius
Top achievements
Rank 1
Julius asked on 25 Jun 2014, 10:44 AM
 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());
            }
        
        }







1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 27 Jun 2014, 01:01 PM
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!
 
Tags
Upload
Asked by
Julius
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or