I have a dropzone element as follows:
<form action="/file-upload" class="dropzone dz-clickable" id="captureDropzone">
...
</form>
In my router, I have the following:
router.post('/file-upload', function(req, res){
res.end(req.files.file.path);
})
The goal is to capture the response (uploaded file path) in my HTML so that I can do some stuff with the uploaded file. My current understanding is that upon submission of a form, the data gets sent to /file-upload
, where the file is uploaded correctly. However, I'm not sure where the response goes. Given the use of the action
tag, where/how do I capture the response?