c# - 路径链接发送到 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> ");
解决方案
推荐阅读
- python - 如何使用 popen 命令行参数包含单引号和双引号?
- rest - 如何使用 SoapUI 中的 groovy 脚本将查询和标头参数添加到 REST 请求?
- email - 发生致命错误无法写入缓存目录 /home/promozjo/tmp/horde 已为管理员记录详细信息
- javascript - javascript中的正则表达式公式解析
- ionic-framework - ionic - 后退按钮退出应用程序在 Ionic 5 中不起作用
- python - 在 Pandas DataFrame 的一列中查找并替换所有匹配但不区分大小写的字符串
- javascript - 如何添加一个 li 元素,然后添加一个带有文本的子 div 元素?
- c# - 使用 TLS 1.2 通过 C# 连接到本地共享点
- google-apps-script - Google 电子表格应用程序脚本 - 获取选定的非连续范围
- python - Python 请求错误 400 浏览器发送了无效请求