Page 1 of 1

header works in FF but not in IE

Posted: Mon Jul 02, 2007 4:58 pm
by tarja311
Hi all,

I have written a win32 program that uses a custom-made file-type in this format: xtp://78.2.45.43/somefile.zip

When a user copies that into their browser, my program automatically launches itself and downloads the file.

I also have a PHP/SQL database with a bunch of these files that my users can browse and download. I do not want the link itself to be visible to the user so it goes through a download.php&id=$someid.

All of this is ok, my only problem is i cannot get the link to execute my program for downloading. I have tried the following :

Code: Select all

header('Location: xtp://78.2.45.43/somefile.zip');
and it works in Firefox but not in Internet Explorer. In IE i receive a page not found.

Does anyone know why and if possible, a way to get this working the way it should?

Thanks

-- tarja

Posted: Tue Jul 03, 2007 12:16 am
by feyd
I would guess the "xtp" part is the problem.

Posted: Tue Jul 03, 2007 1:40 pm
by tarja311
But when a user copy/pastes the xtp url into IE or FF, my program opens w/o a hitch. :?:

I thought if i used header() it would have the same effect, but it only works in FireFox. I want it to work in IE as well.

Posted: Tue Jul 03, 2007 3:36 pm
by superdezign
What is xtp?

Posted: Tue Jul 03, 2007 5:03 pm
by tarja311
It is a format i have created that only my program recognizes as a downloadable link. When a user pastes an xtp link into their browsers address-bar, the program automatically sees this and downloads the file.

I have a PHP/SQL database with a bunch of these links. Originally the links used to be encased inside an <a href = ... and this worked fine. The program opened up and downloaded the file.

Unfortunately i had to change this design. Now the link itself is inside a /download.php&id=$someid/. When clicked by the user, a header gets sent with the link inside.

Code: Select all

header('Location: xtp://somefile.txt');
But this only works in FireFox. I get a page cannot be found with IE.


I hope i explained it well enough. :?

Posted: Tue Jul 03, 2007 5:28 pm
by superdezign
I thought that may be the case, but it's not often that a developer who's made their own program with a protocol for their downloads had trouble with headers. I'm both impressed and unimpressed. Hehe.

Try meta redirection. Chances are that Firefox doesn't accept that protocol as a valid header. I'd look into the Location: header and see what the standards are.

Posted: Tue Jul 03, 2007 7:07 pm
by volka
Do you send any other http header in the same http response?