Last active
January 8, 2017 13:46
-
-
Save N-Porsh/7786887 to your computer and use it in GitHub Desktop.
PHP: Simple Fast file uploader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Loop through each file | |
for($i=0; $i<count($_FILES['files']['name']); $i++) { | |
//Get the temp file path | |
$tmpFilePath = $_FILES['files']['tmp_name'][$i]; | |
//Make sure we have a filepath | |
if ($tmpFilePath != ""){ | |
//Setup our new file path | |
$newFilePath = "admin/upload/" . $_FILES['files']['name'][$i]; | |
//Upload the file into the temp dir | |
if(move_uploaded_file($tmpFilePath, $newFilePath)) { | |
header("location:index.php?page=about"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good Work