DropZone을 사용하여 파일을 내 nodejs 서버에 업로드하려고합니다. 그러나 게시물이 내 nodejs 서버에 도달 할 때 파일 핸들을 얻는 방법을 알아낼 수 없습니다.dropzone nodejs 파일 업로드
app.post('/file-upload', function (request, response) {
console.log("Route: '/file-upload' ");
console.log("File upload request from user: " + request.body.userName);
// Get a file handle, read the file and then write it out to the file system.
...
});
는이 코드가 실행지고 있음을 볼 수 있습니다
<form action="/file-upload" class="dropzone" id="logoDropZone">
<input type="hidden" name="userName" value="user"/>
</form>
그런 다음 내 nodejs 서버에서 나는 다음과 같은 코드를 가지고 : 내 HTML에 DROPZONE를 인스턴스화하는 방법은 다음입니다. 또한 요청 객체를 통해 입력 필드 (숨겨진 입력 참조)의 값에 액세스 할 수 있습니다. 하지만 파일 자체에 액세스하여 서버 파일 시스템에 파일을 쓸 수있는 방법은 무엇입니까?