Page 1 of 1

wrong file name

Posted: Thu Apr 13, 2006 5:24 am
by boom
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi,
(it is wap page)
i have image, or some video or smth else.

in download.php is do:

Code: Select all

$size = filesize($filename);
type = "image/gif";

header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', time() ) );

header( 'Cache-control: private' );
header( 'Cache-control: max-age=1800' );
header( 'Content-Type: ' . $type );
header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
header( 'Content-Transfer-Encoding: binary' );
header( 'Content-length: ' . $size );
but in the end, when i download smth to mobile, i see download.php, i shoud be nice_image.gif and so on

where is problem?
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Apr 13, 2006 5:35 am
by timvw
Afaik (and according to rfc1806) the value for the filename should not be between quotes:

Code: Select all

header("Content-Disposition: attachment; filename = $filename");
Btw, you might want to check with a hardcoded $filename first
(If i remember well, a couple of browsers don't like filenames like 'foo/bar.txt')

Posted: Thu Apr 13, 2006 5:47 am
by boom
damn, it doesn't work.
timvw wrote:Afaik (and according to rfc1806) the value for the filename should not be between quotes:

Code: Select all

header("Content-Disposition: attachment; filename = $filename");
Btw, you might want to check with a hardcoded $filename first
(If i remember well, a couple of browsers don't like filenames like 'foo/bar.txt')