Hi Everyone,
I've setup a filedownload which works but i'm having an issue, i've
left out but when it downloads it, while it has the correct file it
doesn't have a file extension associated with it, I need the .7z
extension associated with the filename, can anyone see why that would
do this
I think that your problem in this line:
header(Content-Disposition: filename=$file . %20);
I don't know what that %20 is for and you should quote the filename,
that line should be something like this:
header(Content-Disposition: attachment; filename=\$file\);
Considering that $filename
That is for IE and its silly FileName[N] rather than FileName
here a good old function to download:
http://www.devpro.it/code/72.html
Regards
Date: Sun, 6 Sep 2009 15:43:27 -0300
From: tapi...@gmail.com
To: chris_pa...@danmangames.com
CC: php-general@lists.php.net
Subject: Re: [PHP] File
] File download problem
Da:
Stefano Noffke [EMAIL PROTECTED]
Data:
Mon, 18 Aug 2008 16:01:22 +0200
A:
php-general@lists.php.net
A:
php-general@lists.php.net
Greetings,
I need to create a script to let registered users to download files
from a non-public folder.
The files name, type, and size
function instructs PHP to open the file for
reading in a binary safe manner.
Hope this helps.
Ash
www.ashleysheridan.co.uk
Oggetto:
[PHP] File download problem
Da:
Stefano Noffke [EMAIL PROTECTED]
Data:
Mon, 18 Aug 2008 16
Subject:
Re: [PHP] File download problem
From:
Stefano Noffke [EMAIL PROTECTED]
Date:
Tue, 19 Aug 2008 15:17:25 +0200
To:
php-general@lists.php.net
To:
php-general@lists.php.net
I checked the files with an HEX editor, and I found that each downloaded
file starts with EFBBBF, and after those three
I just add this comment for reference.
I found this bug report on the PHP Web site:
http://bugs.php.net/bug.php?id=22108
That bug explains everything :)
Stefano
Stefano Noffke wrote:
Thanks for the reply.
I think I found the problem here: The php file was saved with UTF-8
encoding, and for
That bug report makes sense now, in light of your problem. It wasn't
something I'd ever seen happen before, as most of my work is done on
Linux, and the bug seems to be specific to the way Windows uses the BOM
for UTF-8 PHP files.
Ash
www.ashleysheridan.co.uk
---BeginMessage---
I just add this
At 3:32 PM +0100 8/19/08, Ashley Sheridan wrote:
That bug report makes sense now, in light of your problem. It wasn't
something I'd ever seen happen before, as most of my work is done on
Linux, and the bug seems to be specific to the way Windows uses the
BOM for UTF-8 PHP files.
Ash:
A
Greetings,
I need to create a script to let registered users to download files from
a non-public folder.
The files name, type, and size are stored in a MySQL Database. The user
need to click on a link, and a PHP script should handle the download of
the file.
Here is how I organized it:
Hi Stefano,
You can use this code instead to read in the file and output it to the
browser, as it is binary safe. I've used it for the same reason you
require, and it works fine with video clips.
$fp = fopen($path, rb);
while(!feof($fp))
{
print(fread($fp, 1024));
flush($fp);
}
();
The rb in the fopen function instructs PHP to open the file for
reading in a binary safe manner.
Hope this helps.
Ash
www.ashleysheridan.co.uk
Oggetto:
[PHP] File download problem
Da:
Stefano Noffke [EMAIL PROTECTED]
Data:
Mon
Can any experts on this list explain to me why, despite the 1,000,000
places that application/octet-stream is documented to work, and has
always worked, since Mosaic 1.0 days, people manage to find these
goofball Content-type: headers that are supposed to work, but only
work in a handful of
Richard Lynch wrote:
Can any experts on this list explain to me why, despite the 1,000,000
places that application/octet-stream is documented to work, and has
always worked, since Mosaic 1.0 days, people manage to find these
goofball Content-type: headers that are supposed to work, but only
work
On Thu, June 15, 2006 10:17 am, Jon Anderson wrote:
Richard Lynch wrote:
Can any experts on this list explain to me why, despite the
1,000,000
places that application/octet-stream is documented to work, and has
always worked, since Mosaic 1.0 days, people manage to find these
goofball
Chances are your 1KB file contains an error message - try changing the
Content-Type to text/plain or text/html to see what PHP is throwing at you
Cheers
Chris
Marek Kilimajer wrote:
PHP Junkie wrote:
Ave,
I've been having a very nagging and frustrating problem for a while
and I
hope someone can
Ave,
I made a change last evening, and since the change.. It seems to be working
fine. Thus far I haven't had the 1 KB downloaded file problem. I have been
trying all evening and this morning, from different places, and somehow
right now it seems to be working fine.
What I simply did was this:
From: PHP Junkie [EMAIL PROTECTED]
As my link to the download file, I changed it to
a href=\imsafm_user_dl.php?F=imsafm/$user/$myrow[filename]\img
src=b_newtbl.png border=0/a
And changed the code in the download file to
?php
header(Content-Description: File Transfer);
header(Content-Type:
John Holmes wrote:
From: PHP Junkie [EMAIL PROTECTED]
As my link to the download file, I changed it to
a href=\imsafm_user_dl.php?F=imsafm/$user/$myrow[filename]\img
src=b_newtbl.png border=0/a
And changed the code in the download file to
?php
header(Content-Description: File Transfer);
Ave,
I've been having a very nagging and frustrating problem for a while and I
hope someone can help me out with this.
I created a simple File Manager application, a lot of you already know about
it as you helped me with coding at different stages.
The problem is this: The Download.
When you
PHP Junkie wrote:
Ave,
I've been having a very nagging and frustrating problem for a while and I
hope someone can help me out with this.
I created a simple File Manager application, a lot of you already know about
it as you helped me with coding at different stages.
The problem is this: The
.'' );
header ( 'Expires: ' . date ( 'r', 0 ));
Still getting the same behavior, on both the Windows
and Solaris platforms.
Andy
From: Curt Zirzow [EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 9:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] File Download link not working in
PHP 4.3.4
* Thus
Check the comments on this page:
http://us2.php.net/manual/en/function.session-cache-limiter.php
---John Holmes...
- Original Message -
From: Andrew Hauger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 11:18 AM
Subject: Re: [PHP] File Download link not working
I have a script that dynamically generates a CSV file
for downloading to MS Excel. The script works fine in
PHP 4.3.3 on a Windows machine using Apache 2, and the
exact same script does not work in PHP 4.3.4 on
Solaris 9 using Apache 1.3.29. A script with
essentially the same header commands works
* Thus wrote Andrew Hauger ([EMAIL PROTECTED]):
the file name. When the OK button is clicked, an
error dialog pops up with the message Internet
Explorer cannot download ... [snipped URL]. Internet
Explorer was not able to open this Internet site. The
requested site is either unavailable or
I am having some trouble making it possible to download a file using the
header function. The problems are: (1) I get the dialog box to download the
file, but for some reason the type of file isn't getting passed to the box,
and (2) when I download a 4MB file it only seems to be getting 16.6KB.
Hi there,
I would like to send an arbitrary file to a user. This file will be on
the server in the PHP directory. I will also want to rename it before
it is sent, but keep the old file with the old filename.
Any help is appreciated...
Thanks,
Grant
--
Grant Rutherford
Iders Incorporated
600A
Maybe I should clarify this:
I have a the php file:
/var/www/html/dev/view_files_disply.php
This file accepts a POST argument which identifies $filename (example
1392_foobar.txt) of a file stored on the server at:
/var/www/html/files/1392_foobar.txt
This filename is generated by PHP and is
Hello,
I have some files on a website which the user can download (e.g. pdf,
zip...). The files sould not bw displayes but the browser should aks the
user what to do (e.g. save it to disk, open it). My code look like this:
header(Content-type: application/octet-stream);
Found the problem. It is the odbc_connect() that cause the download to fall
short of completing it's download. Weird! I think it's because the
database connection have a slower response time than the download response
time. PHP header should not be affected by the odbc function... But then I
Hi!
I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to cause the
webserver to download the file to the web browser. Some of the time it work
and some of the other time, it doesnt. I haven't figured out why until I
looked in the error log which showed hte problem... See two
At 16:15 21-7-03, you wrote:
Hi!
I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to cause the
webserver to download the file to the web browser. Some of the time it work
and some of the other time, it doesnt. I haven't figured out why until I
looked in the error log which showed
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
Hi!
I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to
cause the webserver to download the file to the web browser. Some
of the time it work and some of the other time, it doesnt. I
haven't figured out why until I
Um, problem is I don't have any scripts before this sample header function.
So, something is up. Does the file size 49 MB have something to do with it?
Okay, saw both of the replies, so will check them out.
Thanks,
Scott
Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
*
btw, also on the content-disposition, not only will some browsers not
honor that, they will just use the name of the script as the 'save-as'
filename.
That's okay with the 'save as' filename because no one know hte real
filename on the webserver because it is renamed when it is download
On Friday 04 April 2003 15:29, b b wrote:
It would be:
a
href=downloadFile.php?daFile=path/fileNamepath/fileName/a
I tried to print the _GET['daFile'] however if I am
using the header function in the same file then it
won't print a thing.
Well, disable the file downloading section for
Hi,
Anybody knows the solution to the following:
I am trying to force the download of a file called
dadada.txt.
I have a file named downloadFile.php
It is invoked like this:
a
href=downloadFile.php?daFile=path/dadada.txtdadada.txt/a
However within the downloadFile.php the $daFile
Hi,
Why would the $daFile in the following code be
resolved to . I am passing it via the url.
?
session_start();
if($_SESSION['isValidSession'] == 'Y'){
$daFile = $_GET['daFile'];
$size=filesize($daFile);
On Friday 04 April 2003 13:51, b b wrote:
Why would the $daFile in the following code be
resolved to . I am passing it via the url.
?
session_start();
if($_SESSION['isValidSession'] == 'Y'){
$daFile = $_GET['daFile'];
- What URL are you using?
- Have you taken
It would be:
a
href=downloadFile.php?daFile=path/fileNamepath/fileName/a
I tried to print the _GET['daFile'] however if I am
using the header function in the same file then it
won't print a thing. In fact it starts downloading.
The only thing is that it doesn't catch the correct
file name
Hello
I have a script that after login gives the user access to one directory. The
directory depends on their login.
After login a list of files is displayed with a check box in front of each file.
Under the list of files there are several buttons, Copy, Delete, Rename, Upload, and
Download.
: [PHP] File Download
Hello
I have a script that after login gives the user access to one directory.
The
directory depends on their login.
After login a list of files is displayed with a check box in front of each
file.
Under the list of files there are several buttons, Copy, Delete, Rename
Hello,
I have this simple script called index.php in a directory protected with
HTTP auth (require valid-user):
?php
$archivo = '/somewhere/out/docroot/registro.csv';
header('Content-Type: application/octect-stream');
header('Content-Length: '.filesize($archivo));
]
Sent: Wednesday, November 06, 2002 6:29 AM
Subject: [PHP] File download + HTTP auth problem.
Hello,
I have this simple script called index.php in a directory protected with
HTTP auth (require valid-user):
?php
$archivo = '/somewhere/out/docroot/registro.csv';
header('Content
Rogers
Cc: John W. Holmes; [EMAIL PROTECTED]
Subject: Re[2]: [PHP] File download doesn't work with SSL
Why not just a simple wget -S https://... to see the headers?
On Tue, 8 Oct 2002, Tom Rogers wrote:
Hi,
Tuesday, October 8, 2002, 1:32:16 PM, you wrote:
JWH Thanks for the help
]: [PHP] File download doesn't work with SSL
Okay, I tried just a page with only session_start() in it and the page
does send a no-cache, no-store header.
output from wget
D:\wgetwget -S http://coconut/usap/test.php
--08:04:13-- http://coconut/usap/test.php
= `test.php
...
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 8:08 AM
To: 'Rasmus Lerdorf'; 'Tom Rogers'
Cc: [EMAIL PROTECTED]
Subject: RE: Re[2]: [PHP] File download doesn't work with SSL
Okay, I tried just a page with only session_start
'; [EMAIL PROTECTED]
Subject: RE: Re[2]: [PHP] File download doesn't work with SSL
Right, I figured you knew this as it is documented. You can change
that
in your php.ini file using the session.cache_limiter directive.
-Rasmus
On Tue, 8 Oct 2002, John W. Holmes wrote:
Also, FYI, pages
Everyone,
I've had a simple download script working where a user would click on a link and the
program would send word or excel headers instead of HTML. The file would then be
opened in the appropriate program and the user could save/edit it.
Now that we've loaded everything under SSL, it
Does it work with a different browser? Smells like an IE bug to me.
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
Everyone,
I've had a simple download script working where a user would click on a link and the
program would send word or excel headers instead of HTML. The file would then be
Does it work with a different browser? Smells like an IE bug to me.
Doesn't everything with IE smell like a bug?
Anyhow, it works fine with Netscape. Opera will not open the file, but will
save-as just fine when prompted.
I'm off to search MS...deity of choice help me...
---John Holmes...
in my
code.
Any help is appreciated.
---John Holmes...
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL
Does it work
, October 07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL
Does it work with a different browser? Smells like an IE bug to me.
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
Everyone,
I've had a simple download script working where a user would click on a
link
07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL
Does it work with a different browser? Smells like an IE bug to me.
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
Everyone,
I've had a simple download script working where a user would click
John W. Holmes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL
Does it work with a different browser? Smells like an IE bug to me.
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote
Holmes...
- Original Message -
From: Rouvas Stathis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: 1LT John W. Holmes [EMAIL PROTECTED]
Sent: Monday, October 07, 2002 2:00 PM
Subject: Re: [PHP] File download doesn't work with SSL
John,
problem is broken HTTP/1.1 implementation
Are you sure?
I think (I might be wrong) using PHP sessions automatically sends the
Cache-Control header. I cannot remember what directives it uses.
Perhaps the fact that you do not use correct case makes PHP miss the
fact that you want to reassign Cache-Control to use a different value?
If
PROTECTED]]
Sent: Monday, October 07, 2002 8:45 PM
To: Rasmus Lerdorf
Cc: 1LT John W. Holmes; [EMAIL PROTECTED]
Subject: Re: [PHP] File download doesn't work with SSL
Are you sure?
I think (I might be wrong) using PHP sessions automatically sends the
Cache-Control header. I cannot remember
You can have multiple directives in that header:
Cache-Control: no-cache, no-store
Do you have a way to view the HTTP?
Chris
John W. Holmes wrote:
I had tried it with both cases, actually, just to be sure. It did not
make a difference. If the session is sending a no-cache header, would
then
You can have multiple directives in that header:
Cache-Control: no-cache, no-store
Do you have a way to view the HTTP?
No. Can you recommend a good method on windows? Should I get lynx or
does opera have a method to view all the headers?
---John Holmes...
--
PHP General Mailing List
You can have multiple directives in that header:
Cache-Control: no-cache, no-store
Do you have a way to view the HTTP?
No. Can you recommend a good method on windows? Should I get lynx or
does opera have a method to view all the headers?
can't you view all headers etc in the source
Hi,
Tuesday, October 8, 2002, 12:13:59 PM, you wrote:
You can have multiple directives in that header:
Cache-Control: no-cache, no-store
Do you have a way to view the HTTP?
JWH No. Can you recommend a good method on windows? Should I get lynx or
JWH does opera have a method to view all
Tuesday, October 8, 2002, 12:13:59 PM, you wrote:
You can have multiple directives in that header:
Cache-Control: no-cache, no-store
Do you have a way to view the HTTP?
JWH No. Can you recommend a good method on windows? Should I get lynx
or
JWH does opera have a method to view all
Hi,
Tuesday, October 8, 2002, 12:59:40 PM, you wrote:
JWH Wouldn't everything be encrypted, though, since it's over SSL? Including
JWH the headers?
JWH Unfortunately, the way they set up the server, it will not process any
JWH unsecured requests now.
JWH ---John Holmes...
Yes it is encrypted
Yes, you're right. You might want to turn off the forced SSL temporarily
to debug this, if that's possible. Nothing other than your browser or
the Web server will be able to show you the HTTP communication over SSL,
because it's all trash to everything in between.
There may be settings in
. :)
---John Holmes...
-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 11:22 PM
To: [EMAIL PROTECTED]
Cc: 'Tom Rogers'; [EMAIL PROTECTED]
Subject: Re: [PHP] File download doesn't work with SSL
Yes, you're right. You might want
Hi,
Tuesday, October 8, 2002, 1:32:16 PM, you wrote:
JWH Thanks for the help guys. Like I said, the download works fine as long
JWH as it's not over SSL. I will try to disable it and see if I can look at
JWH the headers sent to see if a no-cache header is being sent, even though
JWH I haven't
Why not just a simple wget -S https://... to see the headers?
On Tue, 8 Oct 2002, Tom Rogers wrote:
Hi,
Tuesday, October 8, 2002, 1:32:16 PM, you wrote:
JWH Thanks for the help guys. Like I said, the download works fine as long
JWH as it's not over SSL. I will try to disable it and see if
I'm using version 6 of IE and Netscape
I'm allowing the user to open/dowload a file from a secure locaiton on our
server. Under Netscape it works great! Under IE, it doesn't work at all.
IE complains about not being able to read from the server.
Anyone know of any workarounds?
here's the
Hello,
Can anyone point me towards a tute (or any info) about using php to upload
and download medium size (~500k-1meg) files into a mySQL database (as
blob's i assume).
Cheers,
Brad
Nel vino la verità , nella birra la forza, nell'acqua i bacilli
Hi!
How on earth do I make Internet Explorer to download a file generated with:
header(Content-type: application/octet-stream);
header(Content-Disposition: attachment; filename=$fname);
include($this-dir . $fname);
exit;
It works on http but I need it on https
I think this is only an issue with an un-patched IE5.01, anything higher
than that should work fine.
.b
-Original Message-
From: Negrea Mihai [mailto:[EMAIL PROTECTED]]
Sent: 23 April 2002 12:26
To: [EMAIL PROTECTED]
Subject: [PHP] file download in IE
Hi!
How on earth do I
On Tue, 23 Apr 2002, .ben wrote:
I think this is only an issue with an un-patched IE5.01, anything higher
than that should work fine.
In my experience, there're problems even with MSIE 6.x.
Regards,
Rodolfo.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hey all. Im trying out a script that where I can download the contents
of a database as a dump.
On a large database, the end get truncated. ie, there were still maybe
6-7 more tables more till the end out of maybe 100 tables.
The behaviour is erratic. It is not consistent with where the dump
Hi there. I have a small php app that allows a user to download a txt file
that's created 'on the fly' from a database. Everything is working great
except for the actual results displayed on the file...it get results similar
to the code below...it's insertng br tags (and square characters) all
Hi there. How would I go about downloading a file off of the server. The
filename will always be the same in my case. Say it is sitting in a
directory called 'textfiles'. What method/function would I use to download
it to a user's local system?
Thx Joe:)
--
PHP General Mailing List
You can just link to the file eg
a href=yourfilenamehere.whatever_extdownload file/a
just make sure the path is correct.
Joe Van Meer wrote:
Hi there. How would I go about downloading a file off of the server. The
filename will always be the same in my case. Say it is sitting in a
directory
When using PHP to generate a download file, the PHP program generates the
headers and the actual text content of the file and this all works just
fine. However, after the file download is complete, positioning the mouse
anywhere over the browser (still showing the previous page) it appears as
When generating a download file from PHP to IE (Netscape is not used by my
client base) the browser prompts with an option to download the file or open
the file where it is. Opening the file fails and I am forced to download
the file to my local drive before receiving another prompt to open the
:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 7:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] File Download IE behavior
When generating a download file from PHP to IE (Netscape is not used by my
client base) the browser prompts with an option to download the file or open
the file where
Hi all,
I have a script getfile.php which when I call like getfile.php?fileid=12 and
it returns the file to the browser with the appropiate mime headers etc..
however a problem has recently come where when I have a link to this from a
page then it prompts me to download the page I'm calling
Hi everyone!
I need user to dowload a file from my server ( Apache ), what i do is:
?
header(Content-Type: application/download);
header(Content-Disposition: attachment; filename='report.txt');
echo file contents;
?
It was working till now but sudenly i start recieve the message from
PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 23, 2001 9:44 AM
Subject: [PHP] file download
Hi everyone!
I need user to dowload a file from my server ( Apache ), what i do is:
?
header(Content-Type: application/download);
header(Content-Disposition: attachment; filename='report.txt
G'Day,
I would like to do the following when a user clicks on a link to this PHP
script. The script would be located on www.myserver.com but the page with
the link would be on a mirror say in Australia (www.someserver.com.au):
- Log info about the user download request to a text file
- Display
stopped the DL in the middle. From it's point of view
you asked
for a 1MB file and you got it... so checking the log file will not work.
berber
-Original Message-
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 12:44 PM
To: Php-General
Subject: [PHP] File Download
On Wednesday, January 31, 2001 at 12:00 PM, "Boaz Yahav"
[EMAIL PROTECTED] wrote:
Seems like your theory doesn't stand the reality test :)
This is the script which for some reason works with Netscape but not with
IE
(it used to) :
ignore_user_abort(0);
$filename="test.gz";
"Boaz Yahav" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Is it possible to find out if a client finished to DL a file?
Suppose i put a link to a file and people start to DL the file.
Some people can stop the DL in the middle. I need to know
how many people
ay, January 31, 2001 10:44 AM
Subject: [PHP] File Download Completion
Is it possible to find out if a client finished to DL a file?
Suppose i put a link to a file and people start to DL the file.
Some people can stop the DL in the middle. I need to know
how many people completed the DL.
, 2001 2:55 PM
To: Boaz Yahav; Php-General
Subject: Re: [PHP] File Download Completion
Hi Berber,
The only way I've figured this at the moment is to use the web server access
logs. They will tell you how many bytes were transfered, if it matches the
file size then transmission was potentialy
ginal Message-
From: Daniel Grace [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 2:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] File Download Completion
"Boaz Yahav" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Is it possible
90 matches
Mail list logo