Jump to content

Recommended Posts

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(); 
?> 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.