From 837ef734f17027142490516141e8acc5da11b0be Mon Sep 17 00:00:00 2001 From: Theophilus Omoregbee Date: Fri, 6 Oct 2017 08:30:20 +0100 Subject: [PATCH 1/5] added skipper for ftp file server --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index f766080..daa5d0f 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,40 @@ It exposes the following adapter-specific options: container | ((string)) | The container to upload your files into, e.g. `"my_cool_file_uploads"` (_required_) +#### Uploading files to FTP File server + +```shell +$ npm install skipper-ftp --save +``` + +[skipper-ftp](https://github.com/theo4u/skipper-ftp) This is used to upload files directly to FTP server skipper adapter and [node-ftp](https://github.com/mscdex/node-ftp) +```javascript +req.file('file') +.upload({ + adapter: require('skipper-ftp'), + host: 'ftp.localhost', + port:'21', + username:'root', + password:'root', + path:'/' +}, function whenDone(err, uploadedFiles) { + if (err) return res.negotiate(err); + else return res.ok({ + files: uploadedFiles + }); +}); +``` + +| Option | Type | Details | +|----------- |:----------:|---------| +| `host` | ((string)) | An optional parameter of the host or domain. Default value: `ftp.localhost`| +| `port` | ((number)) | An optional parameter for port. Default value :`21`| +| `path` | ((string)) | An optional parameter if you wish to save the file in a particular path in your file server. Default value :`/`| +| `username` | ((string)) | An optional parameter for authentication. Default value :`root`| +| `password` | ((string)) | An optional parameter for authentication. Default value :`root`| + + +