1.2.3 • Published 5 years ago

gulp-file-post v1.2.3

Weekly downloads
143
License
MIT
Repository
github
Last release
5 years ago

gulp-file-post

npm npm

Upload file to remote server via http post.

Install

npm install gulp-file-post

Example

var gulp = require('gulp');
var upload = require('gulp-file-post');
var del = require('del');

// upload a zip file and decompress on the server
gulp.task('upload', function() {
  return gulp.src('./dest.zip')
    .pipe(upload({
      url: 'http://example.com/receiver.php',
      data: {
        to: '/path/file/goes'
      },
      timeout: 10000
    }).on('error', function(err) {
      // catch error message
    }).on('end', function(){
      // do something else
    });
  );
});

// upload multiple files
gulp.task('uploadCss', function() {
  return gulp.src('./dest/css/**/*')
    .pipe(upload({
      url: 'http://example.com/receiver.php',
      root: 'dest',
      remotePath: '/path/file/goes'
    }).on('error', function(err) {
      // catch error message
    }).on('end', function(){
      // do something else
    });
  );
});

options

nametypedescriptionrequired
urlstringremote server receiver
rootstringbased root to assemble remote path while uploading multiple files
remotePathstringremote relative path while uploading multiple files
dataobjectobject of a formdata
timeoutnumberinteger of milliseconds to wait for server responding
callbackobjectcallback function

License

MIT

1.2.3

5 years ago

1.2.2

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago