@fractools/fileserver
v0.4.0
Published
Fileserver for Fractools Nodes
Downloads
19
Readme
Fileserver
This is a Module for FractoolsNode
Upload a File
Attention: The fallowing is not finished yet!
Async Method
// Define Fileserver
const fileserver = 'http://localhost:8000/'
// Initialize the form data
const formData = new FormData();
let file = {} // File from Form
let dest = '' // Destination Path
// Add the form data we need to submit
formData.append('file', file);
formData.append('dest', dest);
try {
let res = await axios.post(`${fileserver}upload`, formData)
console.log('PDF uploaded', res)
} catch (err) {
console.log('PDF Upload Error: ', err);
}
File will now be uploaded in /uploads/[...]
Destination
You can define subfolder like the fallowing example:
foo/bar
this will upload the file into
/uploads/foo/bar/file.suffix