header works in FF but not in IE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tarja311
Forum Commoner
Posts: 73
Joined: Fri Oct 20, 2006 10:57 pm

header works in FF but not in IE

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I would guess the "xtp" part is the problem.
tarja311
Forum Commoner
Posts: 73
Joined: Fri Oct 20, 2006 10:57 pm

Post 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.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

What is xtp?
tarja311
Forum Commoner
Posts: 73
Joined: Fri Oct 20, 2006 10:57 pm

Post 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. :?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Do you send any other http header in the same http response?
Post Reply