I am trying to upload files as a gulp task
gulp.task('ftp', function () {
return gulp.src('public/js/myapp.js')
.pipe(tasks.ftp({
host: '111.111.111.11',
user: 'USER',
pass: 'PASS',
port: 22
}));
});
The above does not work because the default path is root, I need to guide it into var/www/mysite I am not sure where to go from here, I am tired of manually uploading my files when I make changes to them. Any help would be much appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Are you using the gulp-ftp plugin? <br> <br>https://github.com/sindresorhus/gulp-ftp <br> <br>There is a “remotePath” path option you can use. So it would look like: <br> <br><pre> <br>gulp.task(‘ftp’, function () { <br> return gulp.src(‘public/js/myapp.js’) <br> .pipe(tasks.ftp({ <br> host: ‘111.111.111.11’, <br> user: ‘USER’, <br> pass: ‘PASS’, <br> port: 22, <br> remotePath: ‘/var/www/mysite’ <br> })); <br>}); <br></pre> <br>
Yeah I am, It’s not working because event without the remote path (thanks for pointing that out) its not uploading anything to any directory. <br> <br>The ftp credentials are correct I tested them by connecting to my server with filezilla. I am using filezilla to see if its uploading anything and it’s not. <br> <br>I wonder if there is something I need to do configuration wise?
22 is usually port for SSH/SFTP protocol, not FTP. try connecting to port 21 if it’s open, otherwise use https://github.com/gtg092x/gulp-sftp instead of gulp-ftp
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.