david.woosley has asked for the wisdom of the Perl Monks concerning the following question:
Hi.
I'm working on a Linux server that hosts a website using Perl.
I need to download a file to the browser like downloads normally work. The page doesn't change, and the file is immediately downloaded when the user clicks on a link. There are hundreds of thousands of files, and which file gets downloaded depends on the Linux relative path. I do not know the file type. For example, the URL might look like this:
https://www.my-website.com/download.pl?file=path1/path2/filename.ext
What is the Perl code that will accomplish this? I've search the web, and I cannot find a definitive answer. At least not an answer that I understand.
I am not an experienced Perl programmer. Any help will be appreciated.
Thanks,
David
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Download file to browser
by Corion (Patriarch) on Apr 19, 2024 at 15:41 UTC | |
by david.woosley (Initiate) on Apr 19, 2024 at 16:47 UTC | |
by Corion (Patriarch) on Apr 19, 2024 at 17:16 UTC | |
by eyepopslikeamosquito (Archbishop) on Apr 20, 2024 at 08:06 UTC | |
by Fletch (Bishop) on Apr 20, 2024 at 08:14 UTC | |
by marto (Cardinal) on Apr 19, 2024 at 22:49 UTC | |
Re: Download file to browser
by cavac (Prior) on Apr 20, 2024 at 22:39 UTC | |
Re: Download file to browser
by TheloniusMonk (Sexton) on Apr 22, 2024 at 12:26 UTC | |
by marto (Cardinal) on Apr 22, 2024 at 12:32 UTC | |
by david.woosley (Initiate) on Apr 22, 2024 at 19:16 UTC | |
by marto (Cardinal) on Apr 22, 2024 at 19:28 UTC | |
|