uploading an image and create a zip file doesnt work

billyfalcon

New Member
Im trying to upload an image and create a zip file with this image, i watched any codes here, but I dont quite understand. Help, please.PHP\[code\]<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><?require('conecta.php');$uploaddir = '/var/www/subirImagenBD/';$fechaFoto=date('YmdHis').'_'.basename($_FILES['Foto']['name']); if (is_uploaded_file($_FILES['Foto']['tmp_name'])) { $uploadfile = $uploaddir . $fecha . $fechaFoto; move_uploaded_file($_FILES['Foto']['tmp_name'], $uploadfile); $cFoto=basename($_FILES['Foto']['name']); } echo $cFoto." guardada en ".$uploaddir. $fechaFoto."<br>"; $cSQL="INSERT INTO FOTOS (NOMBRE,PIC) VALUES (?,?)"; $stmt=$oConni->prepare($cSQL); $stmt->bind_param("ss", $fechaFoto, file_get_contents($uploaddir. $fechaFoto)); $stmt->execute(); /* $zipFile = $fechaFoto;$zipArchive = new ZipArchive();if (!$zipArchive->open($zipFile, ZIPARCHIVE::OVERWRITE)) die("Failed to create archive\n");$zipArchive->addGlob($fechaFoto);if (!$zipArchive->status == ZIPARCHIVE::ER_OK) echo "Failed to write local files to zip\n";$zipArchive->close();*/?>\[/code\]
 
Top