pirumpi / sftp-upload

Allow to upload the content of a folder to a remote server through SFT utilizing pure Javascript.
40 stars 21 forks source link

use in react native #10

Closed mohsen158 closed 6 years ago

mohsen158 commented 7 years ago

hi how can i use thi in react native?? i get this error bundling failed: "Unable to resolve module fs from D:\\react-native\\taav\\node_modules\\sftp-upload\\lib\\sftp-upload.js:

SpencerTorres commented 7 years ago

fs is a NodeJS library. It can't be packaged to run in browsers.

Using this on the client side is insecure for the remote server's credentials anyway. What I recommend is accepting uploads on the client side with something like react-dropzone and uploading it to a node server. From there you can use this module to forward the uploads to other remote servers.

pirumpi commented 6 years ago

@SpencerTorres thanks for your comment, I think your suggested approach is adequate for what @mohsen158 is trying to accomplish.