1

wordpress プラグインを作成し、アップロード機能を作成しようとしています。ただし、次のエラーが発生します。

Warning: move_uploaded_file(logos/5041796eeedf21346468206.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/logo-updating/logo_menu.php on line 15

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/Applications/XAMPP/xamppfiles/temp/phpeIJRwj' to 'logos/5041796eeedf21346468206.jpg' in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/logo-updating/logo_menu.php on line 15

アップロードするための私のコード:

$tmp = $_FILES['logoUpload']['tmp_name'];

$extension = explode(".", $_FILES['logoUpload']['name']);
$everything = count($extension);

$ext = $extension[$everything - 1];

$newName = uniqid().time().".".$ext;
$newName2 = uniqid().time()."_banner.".$ext;

move_uploaded_file($tmp, "logos/".$newName);

$fullLink = "logos/".$newName;
4

1 に答える 1

0
$path_array  = wp_upload_dir();
    $path = str_replace('\\', '/', $path_array['path']);




        $target_path_sia = uniqid().$_FILES["file"]["name"];
      move_uploaded_file($_FILES["file"]["tmp_name"],$path. "/" . $target_path_sia);
      echo "Stored in: " . $path. "/"  .$target_path_sia;
于 2014-01-03T06:01:30.833 に答える