Hotlink Script

I need a perl script which allows me to give users a hotlink to any type file.

The kind of setup would be along the lines of:

The script must allow me to specify a path to a particular directory.

so if the user then adds the hotlink into an html page like:

<img src="" alt="Big Boat">

the picture can be seen.

and if they put it into a hyperlink like

<a href="">Download Now</a>

the file can be downloaded.

etc... etc...

Can you post the source if you have a solution.


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hmm, that's a simple task to implement in your favorite programming language:
  1. read supplied variables
  2. do a good input data validation on the values of these variables
  3. read the specified resource
  4. send the read data on stdout prepended by a proper HTTP header
  5. install the program on your web server
  6. ready, enjoy

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.