String urlPath = "http://hostname:portno/filepath.pdf";
url = new URL(urlPath);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type", "application/octet-stream");
OutputStream outStream = conn.getOutputStream();
out = new BufferedOutputStream(outStream);
if (byteContent != null && byteContent.length > 0) {
out.write(byteContent);
byteLength = byteContent.length;
}
이 코드는 예외를 제공하지 않고 파일은 내 바람둥이 위치jsf를 사용하여 http 서버에 파일을 저장하는 방법은 무엇입니까?
- 단순히 서버 (그렇지 않으면 모두가 업로드 될 파일과 더 나은)에 파일을 밀어 직접적인 방법 없다? – skaffman