Set last-modified time to download file Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
quroe

Set last-modified time to download file

Unread post by quroe » 2016-10-16, 16:21

When Pale Moon downloads a file, Pale Moon sets file modification time to current time.
I want Pale Moon to add changing option to set server's last-modified time.

"Preserve Download Modification Timestamp" could impliment this.
https://addons.mozilla.org/ja/firefox/addon/preserve-download-modification/
Pale Moon 27 can't use this addon for specification,so I suggest.

"DownThemAll!" can set last-modified time, but it doesn't change downloaded links color to visited.
https://addons.mozilla.org/ja/firefox/addon/downthemall/

Some people desired this suggestion for many years.
https://bugzilla.mozilla.org/show_bug.cgi?id=178506
https://bugs.chromium.org/p/chromium/issues/detail?id=4574
If Pale Moon can this without addon, it is advantage compared to other browsers!

Thanks.

dark_moon

Re: Set last-modified time to download file

Unread post by dark_moon » 2016-10-16, 16:34

On the github site i found this:
The new downloads API does not provide access to the necessary information, so it will not work with Firefox 26+.

So i I would imagine that feature isn't so easy to implemate

quroe

Re: Set last-modified time to download file

Unread post by quroe » 2016-10-16, 17:42

dark_moon wrote:The new downloads API does not provide access to the necessary information, so it will not work with Firefox 26+.
I know it, so I wrote same thing in the thread.
dark_moon wrote:So i I would imagine that feature isn't so easy to implemate
I agree with you...
I will be glad if PM's developers consider this suggestion.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35644
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Set last-modified time to download file

Unread post by Moonchild » 2016-10-16, 19:00

I don't really understand the need for this, maybe someone can explain why on earth you would want a file you recently downloaded to appear much older? Downloading is not the same as copying, and IMHO the browser setting the last modified time to the download time is correct -- it was last written to your drive at that date and time.

FTR: I absolutely depend on the current behavior and saving the original timestamp would be a serious regression. When downloading files, I'm only interested in when it was downloaded because recently downloaded files are more likely to be used than files downloaded long ago. Not having an indication when it was downloaded in the file time stamp would make it impossible for me to know which ones are more recently acquired files.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

GreenGeek

Re: Set last-modified time to download file

Unread post by GreenGeek » 2016-10-16, 21:29

Windows supports 2 dates, created and modified (actually 3 but accessed is useless). Seems like only one of these should be set to download date. Not a problem for me though; I mostly keep track of version #s, and can change date if desired.

New Tobin Paradigm

Re: Set last-modified time to download file

Unread post by New Tobin Paradigm » 2016-10-16, 22:07

The current state of the last modified time is working as intended.

RESOLVED INVALID

quroe

Re: Set last-modified time to download file

Unread post by quroe » 2016-10-17, 16:19

Moonchild wrote:I don't really understand the need for this, maybe someone can explain why on earth you would want a file you recently downloaded to appear much older? Downloading is not the same as copying, and IMHO the browser setting the last modified time to the download time is correct -- it was last written to your drive at that date and time.
I don't think so. Created (accessed) time should be written downloaded time,but modified time should be written last-modified time as possible.
Moonchild wrote:FTR: I absolutely depend on the current behavior and saving the original timestamp would be a serious regression. When downloading files, I'm only interested in when it was downloaded because recently downloaded files are more likely to be used than files downloaded long ago. Not having an indication when it was downloaded in the file time stamp would make it impossible for me to know which ones are more recently acquired files.
If PM sets last-modified time to download file, you can know which ones are more recently.
If you download same name file in same site, you can easily know recently by downloaded time.
But it is difficult to know more recently without modified time if you download mirror file, re-uploaded file, fork...
I have only 5 method to know fork project's files are newer or older (than original/its project).
They are readme, upload date, file version, modified time in archive and last-modified time.
Modified time isn't almighty, but it is one of the method for comparing file.

In addition to comparing, modified time is useful for two reasons.
If I wolud like to know that file's (software's) useful information and details, it helps me using search engine with "AnyTime".
There are many noise without "Anytime", for example old version apps.
And last-modified time tell me update frequency. It is important for me.

Thanks.

New Tobin Paradigm

Re: Set last-modified time to download file

Unread post by New Tobin Paradigm » 2016-10-17, 17:01

You have to consider that we are also a multi-platform codebase and application.. How do you reconcile it with Unix-like operating systems.. Also, remote servers depending on how the file was sent or stored or even restored from a backup makes any dates useless in MOST cases.. Date downloaded makes the most sense for all platforms and as established and expected behavior. If you want something else.. Write a patch or an extension or something than demand we change some arbitrary date to match a date more times than not is arbitrary at the source you get the file from.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35644
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Set last-modified time to download file

Unread post by Moonchild » 2016-10-17, 19:27

Also, don't forget that files distributed via a CDN will always have their last-modified time set to whenever it was last retrieved from the origin server and cached, as CDN servers generally use that data to know when the edge cache expires on files.
It really makes no sense to rely on that for anything.

There is also no guaranteed way of getting this timestamp over http (only possible if the server sends a last-modified response header) and doing this from the async jstransfer module would likely mean a separate connection is needed JUST to get the last-modified data (not something that's desired or even always possible; think of dynamic/generated download links). For FTP it's simpler, because you have the MTDM command to send over an existing connection.

All of this makes it unreliable, arbitrary, and quite pointless to consider a desired core feature.
If you have extensions that provide this feature, then that's good - you can use that. But I don't see it as useful for the browser core.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

quroe

Re: Set last-modified time to download file

Unread post by quroe » 2016-10-18, 09:53

Matt A Tobin wrote:You have to consider that we are also a multi-platform codebase and application.. How do you reconcile it with Unix-like operating systems.. Also, remote servers depending on how the file was sent or stored or even restored from a backup makes any dates useless in MOST cases.. Date downloaded makes the most sense for all platforms and as established and expected behavior. If you want something else.. Write a patch or an extension or something than demand we change some arbitrary date to match a date more times than not is arbitrary at the source you get the file from.
Sorry,I don't consider other platform. Does Unix-like OS treat different behavior? Other platform also looks like using modified time.
That may be true in MOST cases. But I use rental-uploader in specific community, last-modified time helps me there.
I know only Safari can set last-modified time, so that behavior is also right.
I can write simple userscript or modify xpi,so it is difficult to write a patch. Extension is impossible for downloads API. (Strictly speaking, extension can set like DTA. But it doesn't change visited link's color.)
Moonchild wrote:Also, don't forget that files distributed via a CDN will always have their last-modified time set to whenever it was last retrieved from the origin server and cached, as CDN servers generally use that data to know when the edge cache expires on files.
It really makes no sense to rely on that for anything.

There is also no guaranteed way of getting this timestamp over http (only possible if the server sends a last-modified response header) and doing this from the async jstransfer module would likely mean a separate connection is needed JUST to get the last-modified data (not something that's desired or even always possible; think of dynamic/generated download links).
There are many Indivisual sites. They don't use CDN even now.
Yes, that is true. So, I wrote "as possible" and "add changing option". If users think useless this feature, they can disable it.
I think last-modified time is assistance.
Moonchild wrote:If you have extensions that provide this feature, then that's good - you can use that. But I don't see it as useful for the browser core.
I use "Preserve Download Modification Timestamp", but new downloads API doesn't provide necessary information. So PM27 can't.

In spite of long long text, thanks for dealing this suggestion.
I accept rejection.
Thanks, Moonchild and Matt A Tobin!

New Tobin Paradigm

Re: Set last-modified time to download file

Unread post by New Tobin Paradigm » 2016-10-18, 14:30

Well, we would very likely accept a patch to add this functionality to the API opening the door for an extension to be able to modify the correct file-stream metadata or a patch that could add a pref that could control this but also as stated we do not want to force a change in behavior by default on everyone as it could break expected behavior.

If someone feels up to the task then I suppose.. Patches Welcome.

half-moon

Re: Set last-modified time to download file

Unread post by half-moon » 2016-10-18, 18:10

I don't think I stated this before, but the the way thing are now is convenient so I know when I downloaded a file. And knowing when a file was downloaded helps when I'm modding a game and I need to install things in a certain order.