How to raise File Download box in WindowsCE client

From: Pedro Fonseca (nospam_at_pedrofonseca.com)
Date: 05/31/04


Date: 31 May 2004 03:27:34 -0700

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!



Relevant Pages

  • Re: How to raise File Download box in WindowsCE client
    ... > In my PHP website I'm trying to raise a File Download dialog directly ... > in a WindowsCE IE client with the following code: ... > I've been suggested to feed the link directly to the client, ... My understanding is that this is broken in some browsers. ...
    (comp.lang.php)
  • Re: How to raise File Download box in WindowsCE client
    ... >> In my PHP website I'm trying to raise a File Download dialog directly ... and it works perfectly in all PC browsers that I know of. ... >> stop the client WindowsCE browser from displaying garbage binary data ...
    (comp.lang.php)
  • Re: HELP: send binary replies back and forth ???
    ... a client, not a server. ... simple php function to set the timeout), ... Issues in writing php server are: ... >> and communication then goes back and forth between the server and client ...
    (comp.lang.php)
  • HELP: send binary replies back and forth ???
    ... The PHP script receives a request from a client, ... My PHP script loops through all records and sends each of them ONE BY ONE. ... to be able to communicate with apache. ...
    (comp.lang.php)
  • Re: Advantages and disadvantages of PHP?
    ... Sometimes it's PHP, sometimes Java, sometimes something else. ... You'll find, for instance, that while your hosting company offers ASP.NET, their offer in fairly rare, and their price much above equivalent hosting offers in other languages. ... wanted to keep that client. ...
    (comp.lang.php)