0.4.0 • Published 4 years ago

@fractools/fileserver v0.4.0

Weekly downloads
30
License
MIT
Repository
github
Last release
4 years ago

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

0.4.0

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago