서버 컴퓨터에서 exe 파일을 다운로드 할 수 없습니다.원격 위치에서 exe 파일을 다운로드 할 수 없습니다.
I.E. 내 위치 컴퓨터에서 exe 파일을 다운로드하여 디스크에 저장할 수 있지만 다른 서버에서는 저장할 수는 없지만 서버 컴퓨터에서 액세스하려고 할 때 다운로드하지 않고 다음과 같은 오류가 표시 될 수 있습니다.
나는 FileNotFoundException이를 해결하려면 어떻게fileInputStream = new FileInputStream(new File("E:\\Sunnywellshare\\perl\\filezilla.exe"))
//this code is working fine
fileInputStream = new FileInputStream(new File("http://10.127.10.10/test/filezilla.exe"));
//this code is from remote location.and throwing error
: 아래
java.io.FileNotFoundException: http:\10.128.10.60\home\test\filexilla.exe(The filename, directory name, or volume label syntax is incorrect)
내 코드?
여기서'Reader' 클래스는 문자 데이터가 아닌 이진 파일 인'* .exe' 파일을 mangle합니다. 'URL'에서 직접'InputStream'을 사용해야합니다. –
나는 당신의 대답을주기 전에 조금이라도 읽을 필요가 있다고 생각한다. http://docs.oracle.com/javase/tutorial/networking/urls/readingURL.html – Churk
당신의 코드는 HTML 파일을 읽는 데 적합하다.)하지만'* .exe' 파일을 다운로드하는 것은 아닙니다. 이것은 질문에 관한 것입니다. '* .exe'와 같은 이진 데이터에이 코드를 사용하면 파일이 손상됩니다. –