Connecting Tech Pros Worldwide Help | Site Map

How to raise File Download box in WindowsCE client

Pedro Fonseca
Guest
 
Posts: n/a
#1: Jul 17 '05
Greetings!

In my PHP website I'm trying to raise a File Download dialog directly
in a WindowsCE IE client with the following code:

header( "Content-Type: application/octet-stream\n" );
header( "Content-Disposition: attachment; filename=\"$file\"\n" );
header( "Content-Transfer-Encoding: binary\n" );
header( "Content-Length: " . filesize($path.$file) . "\n" );

The dialog does appear, but instead of prompting the user to save a
something.zip filename (for instance) it prompts him to save a file
called script.php (the name of the script that has this code). This is
very strange, since I know that this code is the cookbook approach to
do this, and it works perfectly in all PC browsers that I know of. It
seems that WindowsCE IE completely ignores the filename attribute in
the Content-Disposition HTTP header... :-(

I've been suggested to feed the link directly to the client, through
header("Location: ..."). I did try that, but instead of a dialog, the
client browser just displays the binary file in the HTML page...

Is there a PHP workaround to using the Content-Disposition headers
approach with WindowsCE? And using header("Location: ...") how do I
stop the client WindowsCE browser from displaying garbage binary data
and prompt him to save the file instead?

Sorry if this thread belongs in a more specific WindowsCE newsgroup. I
just thought that, since I'm using PHP, that any PHP user here could
have developed for the WindowsCE before and stumbled on the same
problem...

Thanks!
Best regards!
Nathan Gardiner
Guest
 
Posts: n/a
#2: Jul 17 '05

re: How to raise File Download box in WindowsCE client



"Pedro Fonseca" <nospam@pedrofonseca.com> wrote in message
news:15109a72.0405310227.4b4afa06@posting.google.c om...[color=blue]
> Greetings!
>
> In my PHP website I'm trying to raise a File Download dialog directly
> in a WindowsCE IE client with the following code:
>
> header( "Content-Type: application/octet-stream\n" );
> header( "Content-Disposition: attachment; filename=\"$file\"\n" );
> header( "Content-Transfer-Encoding: binary\n" );
> header( "Content-Length: " . filesize($path.$file) . "\n" );
>
> The dialog does appear, but instead of prompting the user to save a
> something.zip filename (for instance) it prompts him to save a file
> called script.php (the name of the script that has this code). This is
> very strange, since I know that this code is the cookbook approach to
> do this, and it works perfectly in all PC browsers that I know of. It
> seems that WindowsCE IE completely ignores the filename attribute in
> the Content-Disposition HTTP header... :-(
>
> I've been suggested to feed the link directly to the client, through
> header("Location: ..."). I did try that, but instead of a dialog, the
> client browser just displays the binary file in the HTML page...
>
> Is there a PHP workaround to using the Content-Disposition headers
> approach with WindowsCE? And using header("Location: ...") how do I
> stop the client WindowsCE browser from displaying garbage binary data
> and prompt him to save the file instead?
>
> Sorry if this thread belongs in a more specific WindowsCE newsgroup. I
> just thought that, since I'm using PHP, that any PHP user here could
> have developed for the WindowsCE before and stumbled on the same
> problem...
>
> Thanks!
> Best regards![/color]

Pedro,

My understanding is that this is broken in some browsers. I've seen
different results in every different version of IE that I've ever had a look
at.
You may find that selecting 'open' when the script.php download box appears
will open another dialog box with the correct filename.

My only suggestion is to update the client software to the latest version.
It's not something you can control via your PHP script, as far as I am aware


Nathan


Pedro Fonseca
Guest
 
Posts: n/a
#3: Jul 17 '05

re: How to raise File Download box in WindowsCE client


"Nathan Gardiner" <nate@nate.id.au> wrote in message news:<40bc5ae8$0$322$c3e8da3@news.astraweb.com>...[color=blue]
> "Pedro Fonseca" <nospam@pedrofonseca.com> wrote in message
> news:15109a72.0405310227.4b4afa06@posting.google.c om...[color=green]
> > Greetings!
> >
> > In my PHP website I'm trying to raise a File Download dialog directly
> > in a WindowsCE IE client with the following code:
> >
> > header( "Content-Type: application/octet-stream\n" );
> > header( "Content-Disposition: attachment; filename=\"$file\"\n" );
> > header( "Content-Transfer-Encoding: binary\n" );
> > header( "Content-Length: " . filesize($path.$file) . "\n" );
> >
> > The dialog does appear, but instead of prompting the user to save a
> > something.zip filename (for instance) it prompts him to save a file
> > called script.php (the name of the script that has this code). This is
> > very strange, since I know that this code is the cookbook approach to
> > do this, and it works perfectly in all PC browsers that I know of. It
> > seems that WindowsCE IE completely ignores the filename attribute in
> > the Content-Disposition HTTP header... :-(
> >
> > I've been suggested to feed the link directly to the client, through
> > header("Location: ..."). I did try that, but instead of a dialog, the
> > client browser just displays the binary file in the HTML page...
> >
> > Is there a PHP workaround to using the Content-Disposition headers
> > approach with WindowsCE? And using header("Location: ...") how do I
> > stop the client WindowsCE browser from displaying garbage binary data
> > and prompt him to save the file instead?
> >
> > Sorry if this thread belongs in a more specific WindowsCE newsgroup. I
> > just thought that, since I'm using PHP, that any PHP user here could
> > have developed for the WindowsCE before and stumbled on the same
> > problem...
> >
> > Thanks!
> > Best regards![/color]
>
> Pedro,
>
> My understanding is that this is broken in some browsers. I've seen
> different results in every different version of IE that I've ever had a look
> at.
> You may find that selecting 'open' when the script.php download box appears
> will open another dialog box with the correct filename.
>
> My only suggestion is to update the client software to the latest version.
> It's not something you can control via your PHP script, as far as I am aware
>
>
> Nathan[/color]

Thanks Nathan, I appreciate your answering. I didn't have many hopes
of getting the thing done without updating/changing the browser
client, and you confirmed it. Thanks!

Best regards!

Pedro Fonseca (ADETTI/ISCTE)
Closed Thread