Sebastian wrote:
some of my users are complaining that when they try download media
files (mp3, mpeg, etc) their media player opens and doesn't allow them
to physically download the media. These are IE users, firefox seems to
like my code, but IE refuses to download the file and plays it
Richard Lynch wrote:
Right-click is NOT universal.
Macs don't even *have* a right-click!
Doesn't Ctrl-Click do the same as a right click?
Norbert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
some of my users are complaining that when they try download media files
(mp3, mpeg, etc) their media player opens and doesn't allow them to
physically download the media. These are IE users, firefox seems to like
my code, but IE refuses to download the file and plays it instead..
can anyone
@lists.php.net
Sent: Wednesday, August 10, 2005 12:00 PM
Subject: [PHP] force download
some of my users are complaining that when they try download media files
(mp3, mpeg, etc) their media player opens and doesn't allow them to
physically download the media. These are IE users, firefox seems to like
]
To: php-general@lists.php.net
Sent: Wednesday, August 10, 2005 12:00 PM
Subject: [PHP] force download
some of my users are complaining that when they try download media
files (mp3, mpeg, etc) their media player opens and doesn't allow
them to physically download the media. These are IE users
]
To: php-general@lists.php.net
Sent: Wednesday, August 10, 2005 12:00 PM
Subject: [PHP] force download
some of my users are complaining that when they try download media
files (mp3, mpeg, etc) their media player opens and doesn't allow
them to physically download the media. These are IE users
A comment is inline.
Sebastian wrote:
some of my users are complaining that when they try download media
files (mp3, mpeg, etc) their media player opens and doesn't allow them
to physically download the media. These are IE users, firefox seems to
like my code, but IE refuses to download the
On Wed, August 10, 2005 12:49 pm, Chris wrote:
if ($extension != 'txt')
{
header(Content-disposition: inline; filename=\$file[type]\);
}
else
{
// force txt files to prevent XSS
header(Content-disposition: attachment; filename=\$file[type]\);
}
The Content-disposition header is
On Wed, August 10, 2005 12:43 pm, Sebastian wrote:
That would be browser dependent, something you have no control over.
Maybe you can include a little text message saying right-click save
as for the users not intelligent enough to figure it out themselves.
I defy you to find any web browser
Richard Lynch wrote:
On Wed, August 10, 2005 12:49 pm, Chris wrote:
if ($extension != 'txt')
{
header(Content-disposition: inline; filename=\$file[type]\);
}
else
{
// force txt files to prevent XSS
header(Content-disposition: attachment; filename=\$file[type]\);
}
The
On Wed, August 10, 2005 2:07 pm, Sebastian wrote:
if i don't use Content-disposition IE downloads the file as unknown
(mp3, exe, or otherwise) with no extension and the names the file you
are downloading becomes the name of the script that was called. lol?
So here's what you do.
Go ahead and
i was reading about php.net looking for a way to force a download of a txt file,
rather than the browser displaying the file.
i ran into header() that seems to be able to accomplish it... but seeing as i'm very
much a newbie at php, i can't seem to make this work
if the file i want to download
Are you using Internet Explorer? Then it's a feature of IE--it ignores
the disposition headers sent by your server because its registry tells
it that PDF files must be viewed inline. There's a way around it,
although it's a bit kludgy--I wrote a small article about it that you
can find here (it's
this is what i have exactly in my code...
header(Content-Type: application/force-download; name=\$file\);
header(Content-Disposition: attachment; filename=\$file \);
header(Content-Transfer-Encoding: binary);
header(Content-Length: $content_length);
readfile($file_fullpath);
exit;
Which OS and which PHP version?
On Fri, 4 Oct 2002, christian haines wrote:
this is what i have exactly in my code...
header(Content-Type: application/force-download; name=\$file\);
header(Content-Disposition: attachment; filename=\$file \);
header(Content-Transfer-Encoding: binary);
PHP Version 4.1.2
Red Hat Linux release 7.3 (Valhalla) (Kernel 2.4.18-3 on an i686)
Apache/1.3.23
Rasmus Lerdorf wrote:
Which OS and which PHP version?
On Fri, 4 Oct 2002, christian haines wrote:
this is what i have exactly in my code...
header(Content-Type:
thanks for all your help and that last suggestion. it helped me isolate the issue.
which i believe relates to a header previously sent.still debugging it but got a
simple vers running
cheers
christian
Rasmus Lerdorf wrote:
Which OS and which PHP version?
On Fri, 4 Oct 2002, christian
hi all,
i have successfully created a download script to force a user to
download, however attempting to download large files causes an error
saying that the file cannot be found.
my code
header(Cache-control: private);
header(Content-Type: application/force-download; name=\$file\);
readfile()
On Fri, 4 Oct 2002, christian haines wrote:
hi all,
i have successfully created a download script to force a user to
download, however attempting to download large files causes an error
saying that the file cannot be found.
my code
header(Cache-control: private);
thanks rasmus,
i have tried read file but it gave me the same issues as fpassthru.. both cap
on the memory_limit directive withint the php.ini file
any other suggestions maybe?
cheers
christian
Rasmus Lerdorf wrote:
readfile()
On Fri, 4 Oct 2002, christian haines wrote:
hi all,
i
readfile() reads 8k blocks at a time and dumps them out. It does not read
the entire thing into ram, so that wouldn't be what was causing you to hit
a memory limit. You must have done something else wrong then.
-Rasmus
On Fri, 4 Oct 2002, christian haines wrote:
thanks rasmus,
i have
Can anybody tell me why this doesn't work in IE? I need to force download
mp3 files instead of IE5.5 trying to apply a helper app. This code works
fine for NN.
// detect for MSIE bug
if (strstr($HTTP_USER_AGENT, MSIE))
$attachment = ;
else
$attachment = attachment;;
//
22 matches
Mail list logo