ID:               43306
 Comment by:       manish at sakshiinfosys dot com
 Reported By:      d dot tas40 at chello dot nl
 Status:           No Feedback
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP
 PHP Version:      5.2.5
 New Comment:

Hello,

I have created Mobile Software Secured download website.

When user click on download link that time opening box to Download
file.

When Download Click on 'OK' button that time Succesfully downloaded
after Deleted that file and directory.

But, When Download Click on 'Cancel' Button that time also Deleted that
file and directory. Actually Click on 'Cancel' button and user not
Downloaded.

Please i have need to help to Why we know file downloaded Successfully
or not.

If you can not understand my problem than aslo reply me.

Thanks & Regards
Manish Bhuva


Previous Comments:
------------------------------------------------------------------------

[2009-05-06 18:56:54] fali68 at yahoo dot com

I have the same issue with PHP 4.449 and 4.1.2.0 mysql. and worked fine
with pervious version. can somone shed some light on this?
here is the code I'm using
mysql_select_db($database_tred, $conn);
$query = sprintf("SELECT * FROM Files WHERE Files.FileID = %s",
$TID_Recordset1);
$result = MYSQL_QUERY($query, $tred)or die(mysql_error());
$data = MYSQL_RESULT($result,0,"filename"); 
$type = MYSQL_RESULT($result,0,"filetype");
$filesize =  MYSQL_RESULT($result,0,"filesize");
$file = MYSQL_RESULT($result,0,"bin_data");
if($result) {
header("Content-Tranfer-Encoding: binary");
header("Content-Disposition: attachment; filename= $data");
header("Content-length: $filesize");
header("Content-Description: PHP Generated Data");
print ($file);

------------------------------------------------------------------------

[2009-04-03 04:30:10] marcell at equylybra dot com

Also having issues using the same script. I get no errors when
downloading files with sizes below 20Mb.

>From 20Mb files are perfectly downloaded via FTP but are saved with a
corrupted file size (0Kb) when downloaded via PHP. Tryed the solution
proposed by "webmaster at anpera dot net" too but I had no success.

Tryed without Content-Lenght header with no effect. Also tryed with
different Content-Types (e.g.
'application/octet-stream','application/force-download','application/zip').

I am on PHP 5.2.8 with Apache 2.2.11 under Linux

------------------------------------------------------------------------

[2008-12-24 18:31:39] jon at jonraivala dot com

Using strlen of the blob instead of filesize in the header works for
me.

Example - 

header("Content-Length: ".strlen($blob_data));

Hope this helps someone.

------------------------------------------------------------------------

[2008-10-23 09:54:32] arasan at mahiti dot org

I've used this code but the download rate is very slow compared to
ordinary download. whether there is any way to overcome this?

------------------------------------------------------------------------

[2008-09-25 04:51:26] lbarn...@php.net

Please try without any Content-Length header, your HTTP server is
probably using a chunked transfert encoding. Also try with a
Content-Type like 'application/octet-stream'.

Also check the character_set_* variables in your MySQL connection, the
server may try to convert the query or the results if some variables do
not match (blobs are binary but queries and results are not).

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/43306

-- 
Edit this bug report at http://bugs.php.net/?id=43306&edit=1

Reply via email to