Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. ob_start();
  3. include ("../../con/conf.php");
  4.  
  5. ?>
  6.  
  7. <?php
  8. /*Postala Gelen Fotoğraf Değerleri Ardından Zipleme İşlemi*/
  9.     if ($_POST){
  10.         if (extension_loaded("zip")){
  11.             if (count($_POST["dosya"]) > 0){
  12.                 $zip = new ZipArchive();
  13.                 $zipAdi = time().".zip";
  14.                 if ($zip->open($zipAdi, ZIPARCHIVE::CREATE)){
  15.                    
  16.                     $url = 'http://localhost/word.php?id=1';
  17.                     $zip->addFile($url, basename($url));
  18.                     $zip->close();
  19.                    
  20.                     if (file_exists($zipAdi)){
  21.                         header("Content-type: application/zip");
  22.                         header("Content-disposition: attachment; filename={$zipAdi}");
  23.                         readfile($zipAdi);
  24.                         unlink($zipAdi);
  25.                     }else {
  26.                         echo "ZIP Dosyası Bulunamadı!";
  27.                     }
  28.                    
  29.                 }else {
  30.                     echo "ZIP Dosyası oluşturulamadı.";
  31.                 }
  32.             }else {
  33.                 echo "Birşeyler Seçin.";
  34.             }
  35.         }else {
  36.             echo "ZIP Extension Yüklü Değil.";
  37.         }
  38.     }
  39.  
  40. ?>
  41.  
  42. </body>
  43. </html>
  44. <?php
  45. ob_end_flush();
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement