Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- include ("../../con/conf.php");
- ?>
- <?php
- /*Postala Gelen Fotoğraf Değerleri Ardından Zipleme İşlemi*/
- if ($_POST){
- if (extension_loaded("zip")){
- if (count($_POST["dosya"]) > 0){
- $zip = new ZipArchive();
- $zipAdi = time().".zip";
- if ($zip->open($zipAdi, ZIPARCHIVE::CREATE)){
- foreach ($_POST["dosya"] as $dosya){
- $zip->addFile($dosya);
- }
- $zip->close();
- if (file_exists($zipAdi)){
- header("Content-type: application/zip");
- header("Content-disposition: attachment; filename={$zipAdi}");
- readfile($zipAdi);
- unlink($zipAdi);
- }else {
- echo "ZIP Dosyası Bulunamadı!";
- }
- }else {
- echo "ZIP Dosyası oluşturulamadı.";
- }
- }else {
- echo "Birşeyler Seçin.";
- }
- }else {
- echo "ZIP Extension Yüklü Değil.";
- }
- }
- ?>
- </body>
- </html>
- <?php
- ob_end_flush();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement