Ajax Control Toolkit htmleditorextender AjaxFileUpload Path

时间:2013-04-30 12:38:38

标签: asp.net vb.net ajaxcontroltoolkit htmleditorextender

我正在尝试将图像保存到本地路径(我不打算在服务器上部署我的项目)而且我很难将手指放在文件上传的正确路径上:< / p>

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

这不起作用,并且没有图像上传到所述文件夹。出了什么问题?

1 个答案:

答案 0 :(得分:1)

试试这个

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