Skip to content

Instantly share code, notes, and snippets.

@N-Porsh
Last active January 8, 2017 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save N-Porsh/7786887 to your computer and use it in GitHub Desktop.
Save N-Porsh/7786887 to your computer and use it in GitHub Desktop.
PHP: Simple Fast file uploader
<?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");
}
}
}
@adityapooniya
Copy link

adityapooniya commented Jan 8, 2017

Good Work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment