[Webbinder-commits] root fixAttach.php,NONE,1.1
Brought to you by:
jasondiceman,
sylvieg
|
From: Jason D. <jas...@us...> - 2006-03-21 00:16:37
|
Update of /cvsroot/webbinder/root In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8949 Added Files: fixAttach.php Log Message: add fixattach.php --- NEW FILE: fixAttach.php --- <?php if (!isset($_REQUEST['file'])) { echo "Youmust give a paraml file"; die; } if (isset($_REQUEST['dir'])) $dir = $_REQUEST['dir']; else $dir = ''; $file = $dir.'/'.$_REQUEST['file']; $fp = fopen($file, 'rb'); if (!$fp) { echo "file $file can't be read"; die; } $jump = 0; $final = ''; while (!feof($fp)) { for ($i = 0; $i < $jump; ++$i) { fread($fp, 8192*16); } $final .= fread($fp, 8192*16); ++$jump; } fclose($fp); $fp = fopen($file, 'wb'); if (!$fp) { echo "the file must be writable"; die; } fwrite($fp, $final); fclose($fp); echo "Done<br>"; ?> |