如何预设用于保存html页面的文件名?

时间:2022-05-22 05:59:37

I have a webpage like e.g. www.example.com/NYSE/rates. If the user decides to save the html she sees on her local disk, I want to preset the filename she gets, when she clicks "Save as", with NYSE_rates_09_12_2011.html. (Which obviously will be different tomorrow or for a different stock exchange.) Now I always get rates.html as default.

我有一个网页,例如www.example.com/NYSE/rates。如果用户决定保存她在本地磁盘上看到的html,我想预设她获得的文件名,当她点击“另存为”时,使用NYSE_rates_09_12_2011.html。 (显然明天将会有所不同或不同的证券交易所。)现在我总是将rates.html作为默认值。

How can I do that?

我怎样才能做到这一点?

2 个解决方案

#1


3  

It appears that in at least the latest version of the most popular web browsers on Windows (Internet Explorer, Firefox, Chrome, Safari and Opera) the default filename filled in when saving a webpage is taken from the page's <title> tag, so simply making sure the date appears in there should put you right.

看来,至少在Windows上最流行的Web浏览器的最新版本(Internet Explorer,Firefox,Chrome,Safari和Opera)中,保存网页时填写的默认文件名取自页面的

标签,因此只需确保日期显示在那里应该让你正确。</p>

#2


0  

As I found out, this is a known problem with Firefox, that stems from the days of Netscape Navigator. And there is an add-on "File Title" that fixes it.

正如我所知,这是Firefox的一个已知问题,源于Netscape Navigator的时代。并且有一个附加的“文件标题”可以修复它。

#1


3  

It appears that in at least the latest version of the most popular web browsers on Windows (Internet Explorer, Firefox, Chrome, Safari and Opera) the default filename filled in when saving a webpage is taken from the page's <title> tag, so simply making sure the date appears in there should put you right.

看来,至少在Windows上最流行的Web浏览器的最新版本(Internet Explorer,Firefox,Chrome,Safari和Opera)中,保存网页时填写的默认文件名取自页面的

标签,因此只需确保日期显示在那里应该让你正确。</p>

#2


0  

As I found out, this is a known problem with Firefox, that stems from the days of Netscape Navigator. And there is an add-on "File Title" that fixes it.

正如我所知,这是Firefox的一个已知问题,源于Netscape Navigator的时代。并且有一个附加的“文件标题”可以修复它。