save_uri: optionally use a temporary download file
commit9645e930c5feda95fd619373cba1cc631407999e
authorDavid Kettler <kettler@internode.on.net>
Wed, 18 Feb 2009 11:55:29 +0000 (18 22:25 +1030)
committerDavid Kettler <kettler@internode.on.net>
Sat, 21 Feb 2009 11:18:37 +0000 (21 21:48 +1030)
tree54f264563eb5ab711ea747c5003e8d77cd68eced
parent080e20e63088c1f3f39f5a3ea22c17147fe810c2
save_uri: optionally use a temporary download file

This is useful when it is undesirable for some other tool to attempt
to open the downloaded file before it is complete.

If $temp_file is specified then the uri is downloaded to that file and
then renamed to the output_file when the download is finished.  If
$temp_file is the value true then a new temporary file in the same
directory as output_file is used.

The download manager indicates this by showing the temp_file name with
the output_file name following parenthetically.  When the download is
complete and the file is renamed, the download manager will update to
show the new name.

Note that this save_uri usage of the term "temporary" is different to
the download-manager usage; in that case the file is deleted, not
renamed.
modules/save.js