“MOVE_UPLOADED_FILE” Respostas de código

mover o arquivo carregado no PHP

<?php
   if (move_uploaded_file($_FILES['userfile']['tmp_name'], "/documents/new/")) {
      print "Uploaded successfully!";
   } else {
      print "Upload failed!";
   }
?>
Spotless Shark

MOVE_UPLOADED_FILE


<?php
$uploads_dir = '/uploads';
foreach ($_FILES["pictures"]["error"] as $key => $error) {
    if ($error == UPLOAD_ERR_OK) {
        $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
        // basename() may prevent filesystem traversal attacks;
        // further validation/sanitation of the filename may be appropriate
        $name = basename($_FILES["pictures"]["name"][$key]);
        move_uploaded_file($tmp_name, "$uploads_dir/$name");
    }
}
?>

Jealous Jackal

mover o arquivo carregado no PHP

move_uploaded_file(file_path, moved_path)
Spotless Shark

MOVE_UPLOADED_FILE

if (move_uploaded_file($tmp_name, $uploadfile)) {
        //do some code if file properly moved

    }else {
        echo "File could not be successfully moved!<br>";
    }
Armandres

Respostas semelhantes a “MOVE_UPLOADED_FILE”

Perguntas semelhantes a “MOVE_UPLOADED_FILE”

Procure respostas de código populares por idioma

Procurar outros idiomas de código