글쎄,이 업로드 된 파일을 이동하지 않고 유지할 수 있는지 모르겠습니다.
개인적으로, 나는 thusly 히 그것을 구현하는 것이 :
//assuming it hasn't already been started...
session_start();
$filepath = $_SESSION['uploaded_filepath'];
// do whatever you need to with the file
unlink($filepath);
unset($_SESSION['uploaded_filepath']);
session_write_close();
: 당신이 더 많은 처리를 수행 할 때, 두 번째 페이지에서
//assuming it hasn't already been started...
session_start();
//generate a unique filepath
$filepath = PATH_TO_THE_DIR . "/" . time() .
"_" . md5_file($_FILES['formelement']['tmp_name']) . ".csv";
//move the uploaded file
move_uploaded_file($_FILES['formelement']['tmp_name'], $filepath);
//do whatever you need with the file, now at $filepath
//now store the filepath in the session:
$_SESSION['uploaded_filepath'] = $filepath;
session_write_close();
: 업로드 된 파일을받는 페이지에서
을
괜찮습니다. 분명히 PATH_TO_THE_DIR 상수에 대한 사용 권한을 확인해야합니다. 이는 어딘가의 디렉토리 일 것입니다.
저는 이것이 답이라고 생각했습니다. 오 잘. 예제를 제시했기 때문에 선택되었습니다. –