.Zip Uploads

See all posts Reply

.Zip Uploads new!
by Alex, 18 years ago
For some reason, when I try to upload a .zip file the script will say: error : Incorrect type of file

Even though application/zip is allowed on the list. I can upload GIF, JPG, etc uploads just fine.

Here is my upload code:
include("class/class.upload.php");
$upload = new upload($_FILES['file']);
if ($upload->uploaded) {
  $upload->process('./files/');
  if ($upload->processed) {
    echo 'File uploaded, taking you to the optional section...';
    $upload->clean();
  } else {
    echo 'error : ' . $upload->error;
  }
}

Any ideas? ThanksReply
Re: .Zip Uploads new!
by Alex, 18 years ago
Oh, and if it matters, application/zip is in my mime.types file on the server.Reply
Re: .Zip Uploads new!
by colin, 18 years ago
What does say $upload->log after you called the process() method??Reply
Re: .Zip Uploads new!
by Alex, 18 years ago
source is an uploaded file
- upload OK
- file name OK
- source variables
    file_src_name : class.zip
    file_src_name_body : class
    file_src_name_ext : zip
    file_src_pathname : /tmp/phpYa84RV
    file_src_mime : application/x-zip
    file_src_size : 24549 (max= 105906176)
    file_src_error : 0
process file to ./files/
- file size OK
application/x-zip, Added that to the array and works fine. Thanks mate!Reply
Re: .Zip Uploads new!
by colin, 18 years ago
My pleasure ;)Reply
Re: .Zip Uploads new!
by Machiel, 18 years ago
Hi,

I'm searching for an upload script which let's me upload files in a zip file. I don't know how I can make this as if I'm a complete noob. So maybe you could share the code you have used perhaps?:$ It would be very helpfull for me.

I hope you can help me with this.

Thanks in advance.Reply