Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['btnsubmitzip'])){
  4.  
  5. $file= $_FILES['txt_zip']['name'];
  6.  
  7. $image_path = "../images/zip/".$file;
  8.  
  9. $copy= copy($_FILES['txt_zip']['tmp_name'] ,$image_path);
  10.  
  11. if($copy)
  12. {
  13. $message="Your Images successfully uploaded";
  14. }
  15. else
  16. {
  17. $message="Error in Image Uploading";
  18. }
  19.  
  20. $zip = zip_open($image_path);
  21.  
  22. if ($zip) {
  23. while ($zip_entry = zip_read($zip)) {
  24. $fp = fopen(DIR_FS_CATALOG."/images/".zip_entry_name($zip_entry), "w");
  25. if (zip_entry_open($zip, $zip_entry, "r")) {
  26. $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
  27. fwrite($fp,"$buf");
  28. zip_entry_close($zip_entry);
  29. fclose($fp);
  30. }
  31. }
  32. zip_close($zip);
  33. }
  34. }
  35.  
  36. ?>
  37.  
  38. <form action="" name="frm" method="post" enctype="multipart/form-data">
  39. <table>
  40. <tr>
  41. <td style="padding-top:30px;">Import Images Zip File &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  42. <input type="file" name="txt_zip" size="40"/>
  43. (size 300 x 300)
  44. </td>
  45. </tr>
  46. <tr><td style="padding-left:30px " class="smallText"><font color="#990000"><strong><?php echo $message; ?></strong></font></td></tr>
  47.  
  48. <tr><td style="padding:20px;"><input type="submit" name="btnsubmitzip" value="Submit"></td></tr>
  49. </table>
  50. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement