Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['btnsubmitzip'])){
- $file= $_FILES['txt_zip']['name'];
- $image_path = "../images/zip/".$file;
- $copy= copy($_FILES['txt_zip']['tmp_name'] ,$image_path);
- if($copy)
- {
- $message="Your Images successfully uploaded";
- }
- else
- {
- $message="Error in Image Uploading";
- }
- $zip = zip_open($image_path);
- if ($zip) {
- while ($zip_entry = zip_read($zip)) {
- $fp = fopen(DIR_FS_CATALOG."/images/".zip_entry_name($zip_entry), "w");
- if (zip_entry_open($zip, $zip_entry, "r")) {
- $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
- fwrite($fp,"$buf");
- zip_entry_close($zip_entry);
- fclose($fp);
- }
- }
- zip_close($zip);
- }
- }
- ?>
- <form action="" name="frm" method="post" enctype="multipart/form-data">
- <table>
- <tr>
- <td style="padding-top:30px;">Import Images Zip File
- <input type="file" name="txt_zip" size="40"/>
- (size 300 x 300)
- </td>
- </tr>
- <tr><td style="padding-left:30px " class="smallText"><font color="#990000"><strong><?php echo $message; ?></strong></font></td></tr>
- <tr><td style="padding:20px;"><input type="submit" name="btnsubmitzip" value="Submit"></td></tr>
- </table>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement