Click to See Complete Forum and Search --> : tar.gz corrupter download php
Rooting
December 24th, 2007, 05:23 AM
hi man..
i have a file *.tar.gz
and this file php
<?php
$file = "./file.tar.gz";
header('Content-Type: application/x-gzip-compressed');
header('Content-Disposition: attachment; filename="'.$file.'"');
header('Content-Transfer-Encoding: binary');
?>
becouse when i download the file, the archive show it's corrupted??..
but the tar.gz in the root folder is right!!..
PeejAvery
December 24th, 2007, 08:12 AM
I don't think that this is a path issue, but rather an actual corrupted file. Download a different file from SourceForge and then test it with you script to see if that acts like its corrupt.
Rooting
December 24th, 2007, 08:28 AM
i donwload it..
it's the same corrupted....the file in teh root of apache is right..
when i download it is corrupted..
a strange problem..any suggestion PeejAvery??
Bored_Womble
December 24th, 2007, 08:34 AM
i could be wrong here, but you are only just returning a header and not the actual file ....
you also need to send the file, after the header ...
BW
Rooting
December 24th, 2007, 10:50 AM
i don't remember to add
readfile($file);
but is the same..
the file is damage or unknow say winrar..
how can i do??.......
it's 10 h that i thothh
PeejAvery
December 26th, 2007, 07:23 PM
I don't think you are completely understanding me, or I can't understand you.
Did you, download normally (through the browser) a different tar.gz file from somewhere, and open it with Winrar? And then try opening that same file using your script?
Rooting
December 30th, 2007, 06:31 AM
I resolved thanks!!..
but now my problem, is that i would download this file,
and not open..
when the browser show me whot i would to do, save or open,
i would like to set save file, whithout open..
i tryed whith
application/force-download
but nothing..
whot can i do??
PeejAvery
January 1st, 2008, 10:23 PM
From what I understand, you want the browser to not have a say in the option of opening the file. If this is what you are attempting, you cannot override that. That is built into the browser itself and cannot be altered by any scripting.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.