Re: Strange Download-File Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 04 December 2004 03:30, Rahul S. Johari wrote:

> Did you mean "imsafm2_download/F=imsafm/rahul/somefile.txt" or
> "imsafm2_download?F=imsafm/rahul/somefile.txt"
> The difference being the ³?² instead of the ³/²
>
> I did actually edited my Apache¹s httpd.conf and added the <Files>
> directive. And I modified my code... Right now it still gives the exact
> same error. I¹m using ³imsafm2_download² instead of ³imsafm2_download.php²
> now in my code. It¹s working on Mac but not on Windows.. Same error on
> windows. So I do believe I need to do more then just adding that Directive
> to fix this problem.

If you have something like this in your httpd.conf:

  <Location /download>
    ForceType application/x-httpd-php
  </Location>

you can then place a php script with the filename 'download' into your "www 
root" directory. Now any request which begins with:

   http://www.yourdomain.com/download

will call your 'download' script.

eg:

  http://www.yourdomain.com/download
  http://www.yourdomain.com/download/file.pdf
  http://www.yourdomain.com/download/category1/file.html?file=file.pdf
  etc.

So, you can construct a sensible URL and use the variables in $_SERVER to 
extract the relevant info required to process your download. 

The best way to play with this is to simply have:

  <?php phpinfo()l ?>

in 'download', then view it like:

  http://www.yourdomain.com/download/put/whateverrubbish/you/want/here

then scroll down to the "PHP Variables" section and see what comes up.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Power is the finest token of affection.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux