$path = realpath( dirname( __FILE__ ) ) . '/Uploads/'; // Upload directory
// Decode content array.
$ContentArray = json_decode( stripslashes( $_POST['content'] ) );
foreach( $ContentArray as $ContentIndividualFilename )
{
echo $path.$ContentIndividualFilename;
// Move uploaded files.
if( copy( $_FILES["files"]["tmp_name"][$ContentIndividualFilename], $path.$ContentIndividualFilename) )
{
}
}
这是错误的$_FILES["files"]["tmp_name"][$ContentIndividualFilename]
因为我通过ajax函数来到这里而没有页面刷新。 $ContentIndividualFilename
包含文件的文件名。如何将文件传输到所需的文件夹?