首页 > 解决方案 > 路径链接发送到 ajax 调用

问题描述

1.我正在尝试使用响应发送我上传的文件路径链接,但它像字符串而不是超链接一样发送。2.代码如下。

  string pathh = @"../../uploads";
  var httpPostedFile = HttpContext.Current.Request.Files["Uploads"];
    if (httpPostedFile != null)
    {
        var filename = httpPostedFile.FileName;
        var fileSavePath = 
        Path.Combine(HttpContext.Current.Server.MapPath("~/uploads"), filename);
        var retpath = fileSavePath;

        httpPostedFile.SaveAs(fileSavePath);
        string newPath = Path.GetFullPath(pathh);
        newPath = Path.Combine(newPath, filename);

        Response.Write("<a href='newPath'>click here</a> ");

标签: c#ajaxresponse

解决方案


推荐阅读