time()
을 사용하여 업로드 한 파일의 이름을 현재 시간으로 변경하고 싶습니다.하지만 새 시간 이름을 삽입 할 위치를 찾지 못하는 것 같습니다.Uploadify - 임시 이름을 시간으로 변경하고 업로드 - PHP
몇 사람이 이것을 살펴볼 수 있습니까?
<?php
if (!empty($_FILES)) {
$newName = time(); <-- Should be the new temp name, insted of the uploaded one.
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
}
echo '1';
?>
'$는 targetfile = 않는 str_replace ('//', '/', $있는 TargetPath)와
$_FILES['Filedata']['name']
를 교체합니다. $ _FILES [ 'Filedata'] [ 'name']'이 줄 ... 필요하면 무엇이든 변경하십시오. $ _FILES [ 'Filedata'] [ 'name']'여기에서 변경하십시오 .. – Red