최종 사용자가 업로드 된 파일 (특히 .csv)의 레코드로 데이터베이스 (MySQL)를 업데이트하는 파일을 업로드 할 수있는 양식 (HTML, PHP)이 있습니다. 그러나 phpscript에서는 파일 이름 만 가져올 수 있으며 파일의 전체 경로는 알 수 없습니다. 이 이유 때문에 fopen()이 실패합니다. 아무도 내가 완전한 경로를 찾는 데 어떻게 일할 수 있는지 알려주시겠습니까?업로드 된 파일의 전체 PATH 가져 오기 -
HTML 코드 :
<html>
<head>
</head>
<body>
<form method="POST" action="upload.php" enctype="multipart/form-data">
<p>File to upload : <input type ="file" name = "UploadFileName"></p><br />
<input type = "submit" name = "Submit" value = "Press THIS to upload">
</form>
</body>
</html>
PHP 스크립트 :
<?php
.....
......
$handle = fopen($_FILES["UploadFileName"]["name"], "r"); # fopen(test.csv) [function.fopen]: failed to open stream: No such file or directory
?>
유용한 정보입니다. –