473,379 Members | 1,260 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How to raise File Download box in WindowsCE client

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!
Jul 17 '05 #1
2 2118

"Pedro Fonseca" <no****@pedrofonseca.com> wrote in message
news:15**************************@posting.google.c om...
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!


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
Jul 17 '05 #2
"Nathan Gardiner" <na**@nate.id.au> wrote in message news:<40********************@news.astraweb.com>...
"Pedro Fonseca" <no****@pedrofonseca.com> wrote in message
news:15**************************@posting.google.c om...
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!


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


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)
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" ...
8
by: Philipp Brune | last post by:
Hi all, the following problem occured to me and I hope somebody can help me : I need to implement an encrypted File download with a PHP script on the server side and a c# client application....
7
by: atse | last post by:
Hi, I want the MP3 audio files to be able to download by users only. Even I set the pages validated by session, anyone still can type the download url to get my files without access of the pages...
1
by: Dan Cimpoiesu | last post by:
I have a remoting object, derived from MarshalByRefComponent, that I instantiate on the client side, with Activator.GetObject. Can I receive events fired on the server, on the client? How?
3
by: Skwish | last post by:
Hi, I would like to download all the files from a folder (of various types i.e. ..txt, .dll, .dat, etc.). I tried Dim MyDir As IO.Directory Dim path As String = Me.MapPath(".") & "\Data" Dim...
2
by: Sleepy | last post by:
I am wanting to allow a client to download a file from a web server and save it on their local PC. The only way that I have found to do this is to use HTTP headers. I am using the code shown below...
6
by: Tim Westmoreland | last post by:
Can someone tell me how to raise an event or trap when the maxlength of a server side textbox has been reached?
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
4
by: pradqdo | last post by:
Hi folks, I have a very strange problem when I try to port my client/server program to cygwin. It is a simple shell program where the server executes client's commands + it can send and receive...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.