Click here to Skip to main content
16,013,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can anybody please help me ,i am getting issue when uploading image from ckeditor
hit is not going to .ashx

my code is

.aspx

<CKEditor:CKEditorControl ID="txtDescription" runat="server" Height="200" Width="600" FilebrowserImageUploadUrl="/BNHabitatBuilder/Upload.ashx">


.ashx

C#
public class Upload : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        HttpPostedFile uploads = context.Request.Files["upload"];
        string CKEditorFuncNum = context.Request["CKEditorFuncNum"];
        string file = System.IO.Path.GetFileName(uploads.FileName);
        uploads.SaveAs(context.Server.MapPath(".") + "\\images\\"       + file);
        string url = "/BNHabitatBuilder/images/" + file;
        context.Response.End();
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}
Posted
Updated 21-Oct-15 6:37am
v2
Comments
Sreekanth Mothukuru 23-Oct-15 4:11am    
Have you tried to debug the code? Does it log any error message in console window (F12)?
Make sure your path is correct to ashx try ../ or ~/
Member 9425683 23-Oct-15 12:15pm    
yes i have debug and now i am able to go server but url is not writing on text box

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