Skip to content

Instantly share code, notes, and snippets.

@lemonlab
Created April 11, 2016 10:46
Show Gist options
  • Save lemonlab/6c9da6a23740d209e3036a421c31fc9f to your computer and use it in GitHub Desktop.
Save lemonlab/6c9da6a23740d209e3036a421c31fc9f to your computer and use it in GitHub Desktop.
<?php
// Dossier de destination
$target_dir = "uploads/";
// Nom du fichier envoyé
$filename = basename($_FILES["file"]["name"]);
// Chemin de destination complet (dossier + fichier)
$target_file = $target_dir . $filename;
// Déplace le fichier envoyé dans le bon dossier
move_uploaded_file($_FILES['file']['tmp_name'], $target_file);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment