1.2.3 • Published 7 years ago

gulp-file-post v1.2.3

Weekly downloads
143
License
MIT
Repository
github
Last release
7 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

7 years ago

1.2.2

9 years ago

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago