User Tools

Site Tools


wiki:download_file_apache_website_by_sending_custom_header

Download file from apache website by sending custom header

Download some file from URL like https://domain.com/somedir/myfile.tar.

In apache host configuration add this:

SetEnvIf X-My-Token "mysecrettoken" my-token
Alias /somedir /var/www/somedir
<Directory /var/www/somedir/>
    Require env my-token
</Directory>

Then you can use wget to get the file and pass it the secret:

wget --header='X-My-Token: mysecrettoken' https://domain.com/somedir/myfile.tar --output-document=/home/user/Downloads/myfile.tar

Tested on

  • GNU Wget 1.20.3
  • Apache/2.4.41

See also

References

wiki/download_file_apache_website_by_sending_custom_header.txt · Last modified: 2022/04/17 12:47 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki