[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Hotlink Script

Posted on 2006-04-26
3
Medium Priority
?
152 Views
Last Modified: 2013-12-25
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:

http://www.example.net/myscript.pl?action=view&file=

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="http://www.example.net/myscript.pl?action=view&file=Picture.jpg" alt="Big Boat">

the picture can be seen.

and if they put it into a hyperlink like

<a href="http://www.example.net/myscript.pl?action=view&file=Download.exe">Download Now</a>

the file can be downloaded.

etc... etc...

Can you post the source if you have a solution.

Thanks

Spiroosx
0
Comment
Question by:spiroosx
1 Comment
 
LVL 51

Accepted Solution

by:
ahoffmann earned 720 total points
ID: 16545041
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question