Strange File Download Problem

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

 



Ave,

Alright... Firstly thanks to everyone who's been trying to help me out.
I've been doing a lot of research and finding out a lot of things. The
problem is definitely very clear... I need to convert the Dynamic URL to
Static URL because, as discussed earlier, Microsoft manages to screw up the
Dynamic part of URL's and thus problems occur.

To remind of what's going on.. I run an Apache Web Server on my PowerMAC G5
Macintosh system, and run my websites on it.

I have a "Force-Download" download script that allows registered users to
Download Files assigned to them.

What has been happening is, when the "Save As" dialog box opens, if you hit
"Save", everything goes well - the file is saved to your desires location,
you can open and view it, HOWEVER, if you hit "Open", it opens the
associated application (eg:- Adobe Acrobat Reader) but fails to open the
file, instead gives an error "File Could Not Be Found".

This is what I did:

Added into my Apache's httpd.conf the following:

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

So that anything begins with www.mydomain.com/download will call my
'download' script.

I put my force download script in a file called "download" in the root
directory. 

Now my URL, instead of looking like
http://informed-sources.com/download.php?F=imsafm/rjohari/ccq.pdf looks
like:
http://informed-sources.com/download/imsafm/rjohari/ccq.pdf

In my Download Script, I was using $F as the variable which contained the
File Path & File Name to be downloaded.
I replaced that with $_SERVER[?PATH_TRANSLATED¹] ...

It works! Accept, it works the same way it was working before. You click the
link, the SAVE AS Dialog box opens.. If you hit Save, the file is saved and
can be opened... HOWEVER, if you hit OPEN, it opens the associated
application and gives the same error.

What am I doing wrong?

Thanks,
Rahul S. Johari


[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