如何更改正在下载的文件的名称 [英] How can I change the name of file being downloaded

查看:62
本文介绍了如何更改正在下载的文件的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是HTML的新手。


什么是HTML< a href>用于将文件下载到与服务器上的名称不同的名称的代码/语法?

我在服务器上存储了许多具有神秘文件名的文件,但我希望这些文件能够下载并以友好名称保存。


有没有办法只使用< a href>命令?

I''m new to HTML.

What is the HTML <a href> code/syntax to download a file to a different name than what is on the server?

I have many files stored on the server with cryptic file names, but I would like the files to be downloaded and saved with a "friendly name".

Is there a way to do this just by using the <a href> command?

推荐答案

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:

展开 | 选择 | 换行 | 行号


这篇关于如何更改正在下载的文件的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆