uprocsaas / any-file Goto Github PK
View Code? Open in Web Editor NEWNode.js library to copy files between several storage sources (ftp, http/https, s3, ssh, local, ...)
License: Apache License 2.0
Node.js library to copy files between several storage sources (ftp, http/https, s3, ssh, local, ...)
License: Apache License 2.0
var anyfile = require(__dirname + "/..")();
var fromFile = "E://fonts.zip";
var toFile ="s3://my_aws_access_key_id:[email protected]/my-bucket-name/fonts.zip";
try {
anyfile.from(fromFile).to(toFile, function (err, res) {
console.log(res);
process.exit();
});
} catch (err) {
console.log(err);
}
I am using the above code to transfer files from my local machine to s3 bucket but I am gettting an error as:
PS D:\Divo-SFTP> node .\upload.js
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'D:\Divo-SFTP/..'
Require stack:
Please help
Do we/Can we support @ in passwords?
Lets say the password contains @ what's the mechanism to escape it.
var anyfile = require("any-file");
const AnyFile = require("any-file/lib");
var af = new AnyFile();
var fromFile =
"s3://secret_key_id:[email protected]/my-test-bucket/filename.zip";
var toFile =
"sftp://username:[email protected]:public_IP/home/pathname/filename.zip";
try {
af.from(fromFile).to(toFile, function (err, res) {
console.log(res);
process.exit();
});
} catch (err) {
console.log(err);
}
I used the same code to tranfer files from my local machine to aws s3 and vice versa and it worked completely fine.
But when I am trying to transfer files from aws s3 to aws ec2 I am getting a true response but the file is not present in the server. I verified it from filezilla. Could you please help me with this. I have also tried removing the colon after amazon.com, tried adding the public IP of my aws ec2 instance but nothing works. I'm getting a true response but the file is not showing up in the server.
I have a folder which has many files.. How to move that in one go?
When deploying an application on Elastic Beanstalk the following error is show.
Error: Cannot find module 'debug'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/var/app/current/node_modules/any-file/lib/index.js:8:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
Everything works before adding any-file.
Current version of this package that is published to NPM has some issues (e.g. usage of fs.exists
which throws). Could you please publish current master to NPM so we can use the updated package.
Hello,
this will fail if a S3 secret key has any "/" on it, which can happen quite often.
The problem seems to be in __parseUrl().
Perhaps checking for the length of username and password in the s3 case could help?
Thanks!
Regards,
Robert
Eu-central-1 doesn't support v2.
Maybe add another parameter to the url or a querystring?
This is not really an issue, more a security relative concern. ,
I need to install any-file with npm, which seems to require aws-sdk
unfortunately my work environement does't allow me to install aws-sdk (please don't ask me where I work)
Error: Cannot find module 'aws-sdk'
Require stack:
I have tried to find a way to install any-file wihtout aws-sdk but with no luck.
Is there a way to overcome that ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.