asp.netvb.netajaxcontroltoolkithtmleditorextender

Ajax Control Toolkit htmleditorextender AjaxFileUpload Path


I'm trying to save an image to a local path (I'm not going to be deploying my project on a server) and I'm having difficulty with putting my finger on the correct path for the file upload:

Protected Sub htmleditorextender_ImageUploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs)
    Dim fullpath = Request.MapPath("~/img/ar") & "/" & e.FileName
    TextBox1_HtmlEditorExtender.AjaxFileUpload.SaveAs(fullpath)
    e.PostedUrl = fullpath
End Sub

This doesn't work, and no image is uploaded to the said folder. What's going wrong?


Solution

  • try this

    Protected Sub HTMLEditorExtender_ImageUploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs)
        Dim fullpath As String = Server.MapPath("~/img/ar/") + e.FileName
        HTMLEditorExtender.AjaxFileUpload.SaveAs(fullpath)
        e.PostedUrl = Page.ResolveUrl(fullpath)
    End Sub