| I will assume you have a standard apache installation. If you don't, then you should
be clever enough to figure how my instructions should be modified to suit your needs.
However, If you aren't, then perhaps you should have used the default apache
configuration. I first downloaded
http://www.terminalp.com/scripts/downloads/File_Upload-6.00.tar.gz from Jeff's website to /usr/local/file-upload
(you can use whatever directory you prefer). NOTE: If you can't access Jeff's site,
I have the tarball on my website at File_Upload-6.00.tar.gz.
Then I unzipped the file:
[root@fred:/usr/local/file-upload] # tar xvfz File_Upload-6.00.tar.gz
file-upload.cgi
README
upload.html
This file contains three files:
| file-upload.cgi |
script which uploads files |
| README |
instructions for use |
| upload.html |
the web page which calls the cgi script |
I followed the instructions in README. So should you. Be warned. Read
that file. Go do it now. Stop reading this. Go. Be gone. You
shouldn't be blindly following my instructions without understanding what they do.
Why, I could be telling you to give a logon on your box and you wouldn't know the
difference. So go read the instructions. Now.
After reading the instructions, I copied the script to the appropriate location:
cp file-upload.cgi /usr/local/www/cgi-bin
Then I modifed the first line of this file to contain:
#!/usr/bin/perl
Then I changed the following lines within the script so they appeared as shown:
$SAVE_DIRECTORY = "/usr/local/www/data/upload";
$ALLOW_INDEX = 1
The first item specifies the upload location. The second item allows filenames
which start with "index". You should carefully consider that last
item. Read the script for details.
Remember to make the cgi script executable:
chmod 755 ./file-upload.cgi
It should look something like this:
-rwxr-xr-x 1 root wheel 13298 Nov 15 14:21 file-upload.cgi
The permissions bit is the important part.
Create the upload directory as specified in the SAVE_DIRECTORY item above:
mkdir /usr/local/www/data/upload
chmod 777 /usr/local/www/data/upload
A sample upload web page is supplied with the script. I copied this to my webpage
as well:
cp upload.html /usr/local/www/data
|