且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何更改正在下载的文件的名称

更新时间:2023-12-03 18:16:04

html无法做到这一点。事实上,它根本不是浏览器的功能。
html cannot do this. In fact, it is not a function of the browser at all.


你好coetzecc,


如果你使用ASP或PHP来提供服务您的文件,您可以使用HTTP标头添加以下信息:
Hi coetzecc,

If you are using ASP or PHP to serve up your file, you can use HTTP headers to add the following info:
展开 | 选择 | Wrap | 行号


hi medicalworker,


感谢您的回复。


让我再给您一些信息。


我正在尝试从WSUS中提取文件。我在网上发现了一个实用工具。现在我正在努力改进它。


该页面是用ASP编写的。它使用SQL查询数据库并返回一个或多个结果。然后我可以下载文件,但文件名很长而且很神秘。


搜索结果包括长长的神秘名称加上友好名称。

我想使用友好的下载代替这个神秘的名字。


这里是ASP代码的摘录:

hi medicineworker,

Thanks for your reply.

Let me give you a bit more info.

I''m trying to extract files form WSUS. I found a utility on the web to do exactly that. Now I''m trying to improve it a little.

The page is written in ASP. It uses SQL to query a database and returns one or more results. I am then able to download the file but the filename is long and cryptic.

The search results include the long cryptic name plus the "friendly name".
I''d like to use that friendly for the downloads instead of the cryptic name.

Here is a excerpt of the ASP code:

展开 | / span> 选择 | 换行 | 行号