SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    force php processing when downloading a file

    Hi all ,

    Im looking into a download system...

    What I was hoping on doing is having links just point to the files in a directory .... and then having a .htaccess file force the url to be processed by a download.php script ... then with the url info deliver the file after checking and register in a db...

    Is it possible and if so ... how would I do this in HTACCESS ??

    Any help would be appreciated!!

    Regards,
    Peanuts
    the neigbours (free) WIFI makes it just a little more fun

  2. #2
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by peanuts
    Hi all ,

    Im looking into a download system...

    What I was hoping on doing is having links just point to the files in a directory .... and then having a .htaccess file force the url to be processed by a download.php script ... then with the url info deliver the file after checking and register in a db...

    Is it possible and if so ... how would I do this in HTACCESS ??

    Any help would be appreciated!!

    Regards,
    Peanuts
    I've no guru with .htaccess, and I haven't tested this, but something along the lines of the following?:

    Code:
    Options +FollowSymLinks 
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^.*$
    RewriteRule ^(.*)$ /download.php?file=\\1 [L]
    My name is Steve, and I'm a super-villian.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •