I am
wondering if this is my headers that are doing this, but I
really dont know.
I think its an IE or Windows behavior and what causes it is the multiple
dots in the filename. I resorted to naming our downloads
filename-v1_0_2_1.exe
-Original Message-
From: Aaron Todd
Hi,
Following class may be usefull.
http://www.phpclasses.org/browse/package/699.html
One Advice :: Please check your script in another
browsers too. some Buggy Browser may cause the
problems.
zareef ahmed
--- Aaron Todd [EMAIL PROTECTED] wrote:
I was going to post another follow-up
On Thursday 12 August 2004 01:06, Aaron Todd wrote:
I am trying to dowload a file using readfile(), but PHP still cant seem to
get to the file.
And what exactly does that mean? Any error messages?
Here is my code:
?php
$file = /home/lgxdlr/test/.$_GET['file'].;
if
Aaron Todd wrote:
snip
?php
$file = /home/dlr/test/.$_GET['file'].;
if (file_exists(basename($file))) {
header(Content-Description: File Transfer);
header(Content-Type: application/force-download);
header(Content-Disposition: attachment; filename=.basename($file));
@readfile($file);
} else
Aaron Todd wrote:
snip
?php
$file = /home/dlr/test/.$_GET['file'].;
if (file_exists(basename($file))) {
header(Content-Description: File Transfer);
header(Content-Type: application/force-download);
header(Content-Disposition: attachment; filename=.basename($file));
@readfile($file);
} else
Thanks for your reply,
I am not getting an error at all. I have coded some error traping so if the
files is not found it will tell you instead of displaying an error. As a
test I took all of that out so the script was:
$file = /home/dlr/test/.$_GET['file'].
header(Content-Description: File
The other guys addressed how to get the script working, but I thought I
might also mention that you're presenting a potential security hole in your
app by not filtering the file name before using it. You'll also want to use
the realpath command on the full file name and path.
-Original
Why would this be a security hole if I do not filter the file name before I
use it?
Thanks,
Aaron
Ed Lazor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The other guys addressed how to get the script working, but I thought I
might also mention that you're presenting a potential
Aaron Todd [EMAIL PROTECTED] wrote in message
$file = /home/dlr/test/.$_GET['file'].;
Why would this be a security hole if I do not filter the file
name before I use it?
http://www.yourdomain.com/yourfile.php?file=../../path/to/any/file/on/machine
---John Holmes...
--
PHP General
A hacker could modify the URL
Mypage.php?file=book.pdf
Becomes
Mypage.php?file=../htdocs/.htaccess
-Original Message-
From: Aaron Todd [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 11:58 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] download script
Why would
I have never done a script that supports resume but this is the logic
you need to follow to work out the protocol behaviour.
- Create a download script as per below start downloading then stop the
web server.
- Change the script to e-mail you the headers from the script request.
- Restart the web
- Original Message -
From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
To: 'Martin' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 10:08 AM
Subject: RE: [PHP] download script
I have never done a script that supports resume but this is the logic
you need to follow to work
]
Organization: U.S. Army
Reply-To: [EMAIL PROTECTED]
Date: Mon, 3 Jun 2002 20:06:42 -0400
To: 'Philip Hess' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] Download Script - Newbie Alert
Store the files above your web root and use a PHP script to control
access.
Use header to set
To: PHP
Subject: Re: [PHP] Download Script - Newbie Alert
You can also check $HTTP_REFERER, it's much simpler
Marek
Clay Loveless wrote:
Something else along these lines -- I really, really wish that more
sites
that use this method would test across multiple browsers and
platforms.
I
Store the files above your web root and use a PHP script to control
access.
Use header to set the appropriate header for the file,
header(Content-Type: application/vnd.ms-excel; name='excel');
header(Content-Disposition: attachment; filename= . $filename .
.xls);
then use passthru() to send
To: 'Philip Hess' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] Download Script - Newbie Alert
Store the files above your web root and use a PHP script to control
access.
Use header to set the appropriate header for the file,
header(Content-Type: application/vnd.ms-excel; name='excel
..
Thank you...
- Original Message -
From: speedboy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 07, 2001 3:16 PM
Subject: Re: [PHP] Download script - sometime works sometime not
My problem,...this script works with somefile but sometime it does
Its works for file .html or.zip or .tar or .tar.gz
But it is not for text file..
Could you recommend how I download text file ?
What do I have to do in my scripts...?
I read the manual about HTTP functionsand search through
mailing list
about header functions
but still
On Wed, 22 Aug 2001 10:19, AD wrote:
Hi,
I'm working on a download script
header(Content-Type: application/octet-stream\n);
header(Content-Length: $size\n);
header(Content-Disposition: attachment; filename=\$file\\n);
header(Content-Description: Download\n);
readfile($path.$file);
19 matches
Mail list logo