Upload ZIP file using a form

  • Answered
I am trying to upload a ZIP file using a HTML form with PHP doing the work. I have had success with other file types, but ZIP does not want to upload. I have added MIME types though the server panel, with no luck to help my problem. Please advice next course of action. User: ctarfq5 PHP Code: for($i=0;$i<10;$i++) { $target_path = "CTA/"; $target_path = $target_path . basename( $_FILES['ULfile']['name'][$i]); if ($target_path != "CTA/") { echo $target_path; echo "
"; } echo $_FILES['ULfile']['tmp_name'][$i]; echo "
"; $fh=fopen('Upload Errors.txt','a'); fwrite($fh, 'Failed to Upload: '); fclose($fh); if ($target_path != "CTA/") { if(move_uploaded_file($_FILES['ULfile']['tmp_name'][$i], $target_path)) { echo "The file ". basename( $_FILES['ULfile']['name'][$i])." has been uploaded"; echo "
"; } else { $fh=fopen('Upload Errors.txt','a'); $tStr="\n\r". basename( $_FILES['ULfile']['name'][$i]); fwrite($fh, $tStr); fclose($fh); } } } Thanks.
Hello mikecam3!

What is the Form part of the code so we can test the upload? We can test it to see whats wrong. Please respond back with the full code you are using.

Best regards,
James R