473,385 Members | 1,780 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,385 software developers and data experts.

Download-Script: strange "[1]." in Filename

Hello folks!

I've got a strange problem with my download-script in conjunction with
M$ internet explorer, if the filename I want to link to includes more
than one points. In Netscape the problem doesn't exist.

For example:

input: ... download.php?name=virtualdub_1.4.9.zip

Expand|Select|Wrap|Line Numbers
  1. header("Content-Type: application/octet-stream");
  2. header("Content-Length: " . filesize($file));
  3. header("Content-Disposition: attachment; filename=".$name);
  4. header("Content-Transfer-Encoding: binary");
  5.  
output: ... save file to disk: virtualdub_1[1].4.9.zip

Plz hlp! Thx.
Kornelius F.

Jul 17 '05 #1
7 3983
Kornelius Finkenbein <ko***@web.de> wrote in message news:<bp************@news.t-online.com>...
Hello folks!

I've got a strange problem with my download-script in conjunction with
M$ internet explorer, if the filename I want to link to includes more
than one points. In Netscape the problem doesn't exist.

For example:

input: ... download.php?name=virtualdub_1.4.9.zip

Expand|Select|Wrap|Line Numbers
  1.      header("Content-Type: application/octet-stream");
  2.      header("Content-Length: " . filesize($file));
  3.      header("Content-Disposition: attachment; filename=".$name);
  4.      header("Content-Transfer-Encoding: binary");
  5.  

output: ... save file to disk: virtualdub_1[1].4.9.zip


Try this:

<?php
header('Content-Type: XXXXXXXXXXXXXX');
//IE need specific header
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE"))
{
header('Content-Disposition: inline; filename="'.$file_name.'"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
}
else
{
header('Content-Disposition: attachment;
filename="'.$file_name.'"');
header('Pragma: no-cache');
}
?>

If it doesn't work read the usernotes at http://in.php.net/header
that may be helpful.

---
"War kills you and me"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2
Thanks for your help, but that didn't solve the problem yet.
I've looked on http://in.php.net/header and searched again in Google,
but I can't find a solution for it.

Perhaps it's the best to eliminate all points in filename except the
last one of course.

Thx. Kornelius

R. Rajesh Jeba Anbiah schrieb:
Kornelius Finkenbein <ko***@web.de> wrote in message news:<bp************@news.t-online.com>...
Hello folks!

I've got a strange problem with my download-script in conjunction with
M$ internet explorer, if the filename I want to link to includes more
than one points. In Netscape the problem doesn't exist.

For example:

input: ... download.php?name=virtualdub_1.4.9.zip

Expand|Select|Wrap|Line Numbers
  1.     header("Content-Type: application/octet-stream");
  2.     header("Content-Length: " . filesize($file));
  3.     header("Content-Disposition: attachment; filename=".$name);
  4.     header("Content-Transfer-Encoding: binary");

output: ... save file to disk: virtualdub_1[1].4.9.zip

Try this:

<?php
header('Content-Type: XXXXXXXXXXXXXX');
//IE need specific header
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE"))
{
header('Content-Disposition: inline; filename="'.$file_name.'"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
}
else
{
header('Content-Disposition: attachment;
filename="'.$file_name.'"');
header('Pragma: no-cache');
}
?>

If it doesn't work read the usernotes at http://in.php.net/header
that may be helpful.

---
"War kills you and me"
Email: rrjanbiah-at-Y!com


Jul 17 '05 #3
Kornelius Finkenbein <ko***@web.de> wrote in message news:<bp*************@news.t-online.com>...
Thanks for your help, but that didn't solve the problem yet.
I've looked on http://in.php.net/header and searched again in Google,
but I can't find a solution for it.

Perhaps it's the best to eliminate all points in filename except the
last one of course.


I dont' think, it will help you. Just checked phpMyAdmin; it also
has the same problem with zip. If even phpMyAdmin guys couldn't solve
this problem, I don't think it's possible. Anyway, you keep on trying.
Probably some HTTP sniff will be useful to you.

---
"Believe it or not, patriotism is one of the worst dividing forces"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #4
ng**********@rediffmail.com (R. Rajesh Jeba Anbiah) wrote in message news:<ab**************************@posting.google. com>...
Kornelius Finkenbein <ko***@web.de> wrote in message news:<bp*************@news.t-online.com>...
Thanks for your help, but that didn't solve the problem yet.
I've looked on http://in.php.net/header and searched again in Google,
but I can't find a solution for it.

Perhaps it's the best to eliminate all points in filename except the
last one of course.


I dont' think, it will help you. Just checked phpMyAdmin; it also
has the same problem with zip. If even phpMyAdmin guys couldn't solve
this problem, I don't think it's possible. Anyway, you keep on trying.
Probably some HTTP sniff will be useful to you.


I checked Yahoo! It doesn't have this problem and so worked on
the headers... Finally found the solution!!!! Now, it works fine!!!

<?php
//This file name: download_zip.php
//Tested in IE6

$filename = "rajesh.zip";
header('Content-Type: application/x-zip-compressed;
filename="foo.bar"');
header('Content-Disposition: attachment; filename="' . $filename .
'"');
readfile($filename);
exit;
?>

<!---html file name: test.html--->

<a href="download_zip.php">test</a>

Now, open the test.html and click the link. Please confirm, if
it's work for you.

---
"Believe it or not, patriotism is one of the worst dividing forces"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #5
Don't know if you understood my problem: I have no problem with the
download-script in conjunction with zip-files. The problem exists only,
if files have more than one point in the filename: f.e.
"virtualdub_1.5.9.zip". Before the first point I get this: "[1]".
The result is this filename: "virtualdub_1[1].5.9.zip".

Your filename "rajesh.zip" has only one point, thats no problem.
BTW, I could not open a test.htm. There were no attachment or link.

But thanks anyway for all.
Kornelius.



I checked Yahoo! It doesn't have this problem and so worked on
the headers... Finally found the solution!!!! Now, it works fine!!!

<?php
//This file name: download_zip.php
//Tested in IE6

$filename = "rajesh.zip";
header('Content-Type: application/x-zip-compressed;
filename="foo.bar"');
header('Content-Disposition: attachment; filename="' . $filename .
'"');
readfile($filename);
exit;
?>

<!---html file name: test.html--->

<a href="download_zip.php">test</a>

Now, open the test.html and click the link. Please confirm, if
it's work for you.

---
"Believe it or not, patriotism is one of the worst dividing forces"
Email: rrjanbiah-at-Y!com


Jul 17 '05 #6
On Mon, 17 Nov 2003 12:11:10 +0100, Kornelius Finkenbein wrote:
Don't know if you understood my problem: I have no problem with the
download-script in conjunction with zip-files. The problem exists only,
if files have more than one point in the filename: f.e.
"virtualdub_1.5.9.zip". Before the first point I get this: "[1]".
The result is this filename: "virtualdub_1[1].5.9.zip".

Your filename "rajesh.zip" has only one point, thats no problem.
BTW, I could not open a test.htm. There were no attachment or link.

But thanks anyway for all.
Kornelius.



I checked Yahoo! It doesn't have this problem and so worked on
the headers... Finally found the solution!!!! Now, it works fine!!!

<?php
//This file name: download_zip.php
//Tested in IE6

$filename = "rajesh.zip";
header('Content-Type: application/x-zip-compressed;
filename="foo.bar"');
header('Content-Disposition: attachment; filename="' . $filename .
'"');
readfile($filename);
exit;
?>

<!---html file name: test.html--->

<a href="download_zip.php">test</a>

Now, open the test.html and click the link. Please confirm, if
it's work for you.

---
"Believe it or not, patriotism is one of the worst dividing forces"
Email: rrjanbiah-at-Y!com


Are you sure you don't have a file already called (whatever it was you were
trying to download) already? Usually the [1] comes when some program (like
IE) has to give a downloaded file a new name because the current file
already exists.

Also, have you tried the page in other browsers? If it works in something
else, it's probably just some sort of client-side problem. You could also
get a header-sniffer to see what the actual filename the script is giving
you is.
--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #7
Kornelius Finkenbein <ko***@web.de> wrote in message news:<bp*************@news.t-online.com>...
Don't know if you understood my problem: I have no problem with the
download-script in conjunction with zip-files. The problem exists only,
if files have more than one point in the filename: f.e.
"virtualdub_1.5.9.zip". Before the first point I get this: "[1]".
The result is this filename: "virtualdub_1[1].5.9.zip".


Sorry for misunderstanding your problem. Yes, it seems to dislike
the extra points in file name. It's really strange.

---
"War kills you and me"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #8

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

Similar topics

3
by: Doug | last post by:
I can't get a form coding to recognize a download.php to download a file to the client. I need the edits of the form for a MySQL table, but the following form code only wants to download...
6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
0
by: Sarah Akers | last post by:
GgF ----gL5cJ72EqiGIQ0SK65Rz Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <head> <style type=3D"text/css">.eyebrow { FONT-WEIGHT: bold; FONT-SIZE: 10px; TE=
0
by: Anne Snow | last post by:
7qs ----bSCMEc0pLIbJxmV9 Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html><head><style type=3Dtext/css>.eyebrow { FONT-WEIGHT: bold; FONT-SIZE= : 10px;...
1
by: Tom | last post by:
Hi, I have a website providing pdf file downloading for registered member. Member needs to login and be able to download pdf file. I save pdf file in a directory. e.g....
1
by: Al | last post by:
Hi! I try to use custom download page (download.aspx) wich writes file (about 700Mb) to response. But I can download only one file from one IP at the same time. I think that this is IIS or...
0
by: kain razial | last post by:
ANYOTHER NEEDS ALSO CONTACT ME.I WILL HELP YOU TO GET THAT TEKLA XSTEEL V 12 DOWNLOAD LINK. http://www.sendspace.com/file/zem32r
0
by: kain razial | last post by:
ANYOTHER NEEDS ALSO CONTACT ME.I WILL HELP YOU TO GET THAT TEKLA XSTEEL V 12 DOWNLOAD LINK. http://www.sendspace.com/file/zem32r
1
by: JayLembeck | last post by:
Over 50,000 Free Ringtone. Get the Latest Ringtone. Download now- Fast, Free and Easy. Get your FREE surprise RINGTONE now! http://seekoutfast.info/free-ringtone/ free ringtone free ringtone new...
1
by: naza | last post by:
Before I start I would just like to say that I am totally new to programming so the things that I am going ask probally will sound basic and I might sound I bit ambitious in what I want to do. The...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.