I need to develop a PHP script that will be able to select files from the server to copy them to the same server but 开发者_高级运维to another directory.
I need to select the file like if I was selecting a file from my local computer.
This is possible? What steps should I take to begin with this script? There are any tutorials out there that exemplifies this scenario?
Best Regards,
Sorry for my English.
Use CKFinder or copy().
copy($sourceFile, $destinationFile);
If $destinationFile exists, it will be overwritten.
UPDATE:
To read the filelist in a specific directory you can use this function:
function dirlist($directory){
if (is_dir($directory)){
if ($handle = opendir($directory)){
while (($file = readdir($handle)) !== false){
$files[] = $file;
}
closedir($handle);
}
}
return $files;
}
精彩评论