shage Posted December 28, 2007 Share Posted December 28, 2007 <?php if ($_POST['action'] == 'add') { $rand = rand(100,999); mkdir('zipfiles/'.$rand.''); $upload_folder = 'zipfiles/'.$rand.'/'; $upload_factsheets = str_replace("'", "", $upload_folder.$rand.$_FILES['fs']['name']); if (move_uploaded_file($_FILES['fs']['tmp_name'], $upload_factsheets)) { system('unzip "'.$upload_factsheets.'"'); print $upload_factsheets; } else { print "<script>alert ('There was a problem with your file');</script>"; } } ?> <form method="post" enctype="multipart/form-data"> <input name="fs" type="file" class="style11normblack" id="fs" /> <input name="Submit" type="submit" class="style11normblack" value="Add" /> <input name="action" type="hidden" id="action" value="add" /> </form> it uploads file but doesnt unzip in folder but unzips in folder where script is Quote Link to comment https://forums.phpfreaks.com/topic/83484-upload-extract/ Share on other sites More sharing options...
zq29 Posted December 28, 2007 Share Posted December 28, 2007 Try: system('unzip "'.$upload_factsheets.'" -d $upload_folder'); Quote Link to comment https://forums.phpfreaks.com/topic/83484-upload-extract/#findComment-424892 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.