我有MVC3C#.Net网络数据。 我们有一个“配对”特征。 用户上载了他们希望“Attach”提交提案的文件。 该文件储存在我们服务器上,等待下载。 这部分工作正在进行。
用户然后在表格中标出的“Attachment”的名称上点击。 我相信,这样做有共同的方法。 我不知道如何。 我如何用超链接下载档案?
我有MVC3C#.Net网络数据。 我们有一个“配对”特征。 用户上载了他们希望“Attach”提交提案的文件。 该文件储存在我们服务器上,等待下载。 这部分工作正在进行。
用户然后在表格中标出的“Attachment”的名称上点击。 我相信,这样做有共同的方法。 我不知道如何。 我如何用超链接下载档案?
为了下载超链接文件,你首先需要把文件名称作为行动路线价值。
@Html.ActionLink("Download", "Download",
new { fileName = Model.AttachmentFileName })
页: 1 NET MVC 建造于 文件:
public ActionResult Download(string fileName)
{
try
{
var fs = System.IO.File.OpenRead(Server.MapPath("/some/path/" + fileName));
return File(fs, "application/zip", fileName);
}
catch
{
throw new HttpException(404, "Couldn t find " + fileName);
}
}
<代码>申请/代码编码>参数是指您重新返回的监评类型。 在本案中,它有案卷。
Here是可能采用的监查系统类型清单。
I am developing a webpage in that the user can download their Resume for Edit. So I have a link to download the article. I use the following code for download. DataTable dt = user.getUserDetails(2); ...
I have recently added functionality for generating pdf reports to a web application. However the reports can be quite large and take some time to show the pdf download dialog. I want to show a spinner ...
I have a very interesting issue with only specific IE implementations. I have an ASPX page that is used to write files down to the user, as part of the process the page uses the following code to ...
I have a intranet site running PHP 5 that needs to list a folder containing only Excel files. Ideally the user needs to be able to input some search criteria (ie date) and the files would be filtered ...
Is there a way to count/calculate the total size of a svn directory if you were to checkout a revision? I have limited internet downloads so I need to know how big something is before I go and ...
I have the code: #!/usr/bin/perl use strict; use WWW::Mechanize; my $url = http://divxsubtitles.net/page_subtitleinformation.php?ID=111292 ; my $m = WWW::Mechanize->new(autocheck => 1); $m-&...
I ve got a Scala program that downloads and parses html. I got the links to the image files form the html, Now I need to transfer those images to my hard drive. I m wondering what the best Scala ...
Im really stumped. Im using the wxHTTP class in wxWidgets to try and download two files. The first request succeeds but the second one fails when wxHTTP->GetInputStream is called. Between downloads, ...