[Techtalk] download_script.php with wget

Cynthia Kiser cnk at ugcs.caltech.edu
Tue Jan 11 11:25:33 EST 2005


Quoting Gretchen Dziengel <gretchen at gretchenann.com>:
> The problem is with urls such as:
> http://www.vim.org/scripts/download_script.php?src_id=3576
> 
> That downloads a file called "download_script.php?src_id3576"  That file
> is not the file I've tried to download either.

No idea what terms one would google with but I remembered this from the man page: 

-E
--html-extension

  If a file of type text/html is downloaded and the URL does not end
  with the regexp \.[Hh][Tt][Mm][Ll]?, this option will cause the suffix
  .html to be appended to the local filename.  This is useful, for
  instance, when you're mirroring a remote site that uses .asp pages,
  but you want the mirrored pages to be viewable on your stock Apache
  server.  Another good use for this is when you're downloading the
  output of CGIs.  A URL like http://site.com/article.cgi?25 will be
  saved as article.cgi?25.html.

  Note that filenames changed in this way will be re-downloaded every
  time you re-mirror a site, because Wget can't tell that the local
  X.html file corresponds to remote URL X (since it doesn't yet know
  that the URL produces output of type text/html.  To prevent this
  re-downloading, you must use -k and -K so that the original version of
  the file will be saved as X.orig.


-- 
Cynthia N. Kiser
cnk at ugcs.caltech.edu


More information about the Techtalk mailing list