호스팅 서버와 로컬 컴퓨터간에 파일을 전송하려고합니다.
내 로컬 컴퓨터에서 호스팅 서버로 작동하도록 관리했지만 다른 방향으로는 작동하지 않았습니다.
내가 얻는 오류는 다음과 같습니다.
스트림을 열지 못했습니다. 해당 파일 또는 디렉토리가 없습니다.
내 코드는 다음과 같습니다.
if(isset($_POST['btnSend'])) //submit button
{
if(count($_FILES['upload']['name']) > 0)
//Loop through each file
for($i=0; $i<count($_FILES['upload']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['upload']['tmp_name'][$i];
$fileType=$_FILES['upload']['type'][$i];
//Make sure we have a filepath
if($tmpFilePath != ""){
//save the filename
$shortname = $_FILES['upload']['name'][$i];
$fp = fopen($tmpFilePath, 'r');
$content = fread($fp, filesize($tmpFilePath));
fclose($fp);
$content = addslashes($content);
$path = 'D:/Resumes_processed/'.$shortname;
copy($tmpFilePath, $path);
}
}
}
서버에 액세스하려면 로컬 컴퓨터에서 FTP 클라이언트를 사용해야합니다. 서버 자체로 전환하지 않는 한 서버 자체는 로컬 컴퓨터에 쓸 수 없습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다