tryingtolearn Posted March 30, 2008 Share Posted March 30, 2008 Is there any special procedures for doing this? I found a script on a forum (But it is dated 2003) not sure if that matters But here is the problem Everything uploads fine and then I go to download and that works as well The problem is that when I try to uncompress (Or is it decompress) the downloaded file It wont, The compressed file extraction wizard says its empty But it isnt - If I email the compressed file to myself it works fine So Im wondering if there is something in the script that is causing the problem <?php error_reporting(E_ALL); $file_path = '/home/public_html/files/'; if (empty($_REQUEST['file']) || !preg_match("/^[a-zA-Z_0-9]+.+[a-zA-Z0-9]+$/", $_REQUEST['file'])) { die('Not a valid URL.'); } header("Content-type: application/octet-stream\n"); header("Content-disposition: attachment; filename=\"" . $_REQUEST['file'] . "\"\n"); header("Content-transfer-encoding: binary\n"); header("Content-length: " . filesize($file_path . $_REQUEST['file']) . "\n"); $fp = fopen($file_path . $_REQUEST['file'], "r"); fpassthru($fp); die(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/98603-question-on-uploading-and-downloading-compressed-zip-files/ Share on other sites More sharing options...
tryingtolearn Posted March 30, 2008 Author Share Posted March 30, 2008 I should also add If I FTP and copy the file from the server to my computer it extracts without any problems as well. Im assuming that means nothing is happening to the file on the way up ??? Quote Link to comment https://forums.phpfreaks.com/topic/98603-question-on-uploading-and-downloading-compressed-zip-files/#findComment-504639 Share on other sites More sharing options...
MadTechie Posted March 30, 2008 Share Posted March 30, 2008 is that the whole script,? it should be ok, you could try this one http://www.phpfreaks.com/forums/index.php/topic,95433.0.html have you could a url i could look at ? Quote Link to comment https://forums.phpfreaks.com/topic/98603-question-on-uploading-and-downloading-compressed-zip-files/#findComment-504647 Share on other sites More sharing options...
tryingtolearn Posted March 30, 2008 Author Share Posted March 30, 2008 Mad Techie, Thanks for the response I found the problem, I was trying to do some database updating during the process I rearranged how that was working and it is working fine now. I appreciate you taking hte time Thanks Quote Link to comment https://forums.phpfreaks.com/topic/98603-question-on-uploading-and-downloading-compressed-zip-files/#findComment-504667 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.