Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Download files script.

Reply
Thread Tools

Download files script.

 
 
mathaios
Guest
Posts: n/a
 
      09-28-2008
Hi.
I want to install a script in my website for the visitors to be able
to download files.
Is there anyone who can replace the values needed to be changed in the
script below for base downloads folder, downloads log file name,
allowed file types
with highlighted example text?

------------------------------------------------------------------------------------------------------------------------------------------
// Allow direct file download (hotlinking)?
// Empty - allow hotlinking
// If set to nonempty value (Example: example.com) will only allow
downloads when referrer contains this text
define('ALLOWED_REFERRER', '');

// Download folder, i.e. folder where you keep all files for download.
// MUST end with slash (i.e. "/" )
define('BASE_DIR','/home/user/downloads/');

// log downloads? true/false
define('LOG_DOWNLOADS',true);

// log file name
define('LOG_FILE','downloads.log');

// Allowed extensions list in format 'extension' => 'mime type'
// If myme type is set to empty string then script will try to detect
mime type
// itself, which would only work if you have Mimetype or Fileinfo
extensions
// installed on server.
$allowed_ext = array (

// archives
'zip' => 'application/zip',

// documents
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',

// executables
'exe' => 'application/octet-stream',

// images
'gif' => 'image/gif',
'png' => 'image/png',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',

// audio
'mp3' => 'audio/mpeg',
'wav' => 'audio/x-wav',

// video
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo'
);
------------------------------------------------------------------------------------------------------------------------------------------

I would be greatful.
 
Reply With Quote
 
 
 
 
Rich Grise
Guest
Posts: n/a
 
      09-29-2008
On Sun, 28 Sep 2008 03:29:26 -0700, mathaios wrote:

> Hi.
> I want to install a script in my website for the visitors to be able
> to download files.


Why not just link to it, and let them click "save to disk"?

Cheers!
Rich

 
Reply With Quote
 
 
 
 
mathaios
Guest
Posts: n/a
 
      10-05-2008
On Sep 30, 2:46*am, Rich Grise <(E-Mail Removed)> wrote:
> On Sun, 28 Sep 2008 03:29:26 -0700, mathaios wrote:
> > Hi.
> > I want to install a script in my website *for the visitors to be able
> > to download files.

>
> Why not just link to it, and let them click "save to disk"?
>
> Cheers!
> Rich


How do i do that?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where download download java.awt.robot class Rafal Majda Java 5 04-18-2005 05:00 PM
problem with code download file - two window file download Sam -- ASP .Net 2 03-17-2005 04:20 PM
Re: How can I display a download link in my (C#) ASP.NET web form to download a file stored in my sql db? Steve C. Orr [MVP, MCSD] ASP .Net 0 03-07-2005 07:14 PM
File upload/download from database. Download appends aspx page to end of file Ryan Taylor ASP .Net 2 11-10-2004 08:31 PM



Advertisments