Skip to content

Instantly share code, notes, and snippets.

@wangkeluo
Created July 15, 2015 05:41
Show Gist options
  • Select an option

  • Save wangkeluo/8875b12651f6efda05c7 to your computer and use it in GitHub Desktop.

Select an option

Save wangkeluo/8875b12651f6efda05c7 to your computer and use it in GitHub Desktop.
<?php
$uploads_dir = '/uploads';
foreach ($_FILES["upload-file-name"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
$name = $_FILES["pictures"]["name"][$key];
move_uploaded_file($tmp_name, "$uploads_dir/$name");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment