Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Could not move file into directory

1 réponse
Avatar
Québec
Bonjour de la part du newbe,

upload.php est dans le dossier JeanPierreDaviau. J'ai tenté tous les paths
possibles.
C:/..//JeanPierreDaviau/
./JeanPierreDaviau/
JeanPierreDaviau/
/JeanPierreDaviau/
/JeanPierreDaviau
etc.

Jean Pierre
http://127.0.0.1/JeanPierreDaviau/upload.html
----------
<html>
<head>
<title>Uploading...</title>
</head>
<body>
<h1>Uploading file...</h1>
<?
$userfile="";
$userfile_size=1;
$userfile_type = "text/plain";

// $userfile is where file went on webserver
// $userfile_name is original file name
// $userfile_size is size in bytes
// $userfile_type is mime type e.g. image/gif

/* echo "Variables are:<br>";
echo $userfile." ".$userfile_name." ".$userfile_size."
".$userfile_type."<br>";
*/

if ($userfile=="none")
{
echo "Problem: no file uploaded";
exit;
}

if ($userfile_size==0)
{
echo "Problem: uploaded file is zero length";
exit;
}

if ($userfile_type != "text/plain")
{
echo "Problem: file is not plain text";
exit;
}

$upfile = "JeanPierreDaviau/".$userfile_name; <==============Problem:
Could not move file into directory

if ( !copy($userfile, $upfile))
{
echo "Problem: Could not move file into directory";
exit;
}


echo "File uploaded successfully<br><br>";
$fp = fopen($upfile, "r");
$contents = fread ($fp, filesize ($upfile));
fclose ($fp);

$contents = strip_tags($contents);
$fp = fopen($upfile, "w");
fwrite($fp, $contents);
fclose($fp);

echo "Preview of uploaded file contents:<br><hr>";
echo $contents;
echo "<br><hr>";

?>
</body>
</html>

1 réponse

Avatar
Québec
Voir-là:

http://206.191.53.193/jeanpierredaviau.com_non_ssl/_uploads/upload.html

Jean