ftp-client | The partial implementation of RFC959 | FTP library
kandi X-RAY | ftp-client Summary
kandi X-RAY | ftp-client Summary
Implementation of a simple FTP client.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ftp-client
ftp-client Key Features
ftp-client Examples and Code Snippets
Community Discussions
Trending Discussions on ftp-client
QUESTION
I've been looking for SFTP python packages, ftpretty works fine for me: https://pypi.org/project/ftpretty/ but I want to use a more secure protocol.
PySftp is obviously a bit outdated (Edit: it seems that pysftp is still frequently used, about the error please see below): https://bitbucket.org/dundeemt/pysftp/src/master/
And throws me several errors on Win10, PyCharm, Python3.6:
...ANSWER
Answered 2021-Mar-07 at 17:24For the first error, it seems like a bug in pysftp
.
You can have a look at the Connection
class here on line 76, and the attribute _sftp_live
is defined on line 134, so this is definitely an error occurring at runtime without being validated correctly. I have also been able to find this related error, which likely explains the cause of this issue; the solution is also mentioned in the error if you want to explicitly fix it.
I would still consider using ftpretty
. It does use TLS
for security and a pretty safe wrapper, you can simply enable it by setting the secure parameter to True (secure=True
) - which by default is set as False
.
QUESTION
I'm trying to download files from sftp in nodejs, I created sftp using springboot I'm able to connect and do get() and put() operation using python/Winscp/ssh commands.
I'm able to connect with my SFTP server but its not downloading the file, it just create empty file in my directory with 0 KB size. I'm not sure what's wrong. It is working if I don't run this in a loop or I have only one file.
I have tried almost all the answers on stack overflow but nothing works for me.
...ANSWER
Answered 2021-Feb-23 at 16:12Did not found the solution.
The ugly solution was to downloaded the whole directory from SFTP instead of downloading file one by one.
QUESTION
I am trying to use ssh2-sftp-client
in NodeJS to send a file from an S3 bucket in AWS to my server.
I have seen many examples and I have tried them all with no success. I feel that this one is close but still is not working for me:
ANSWER
Answered 2021-Feb-05 at 18:16I figured it out. Not sure where exactly the problem was but this will successfully pull a file from S3 and then upload to SFTP server:
QUESTION
I am creating some sort of ftp proxy, so I need to be access ftp as a client, so I used the package ftp
. And of course it works perfectly fine, except that it cant seem to find directories with umlaut character.
Actually its not just the problem of this package, various ftp clients seem to have this issue, I've tried ftp.exe, ftp (linux), and they return (550-The system cannot find the file specified.
) some clients however manage to be able to list it, like the browsers ftp-client (they're going to be deprecated however), Filezilla, or Winscp have no problem.
OPT UTF-8 ON
seems to be ignored 500 Command not understood.
. The server does list it in FEAT
, googling has been of no use since they just retort to using a different client, but I am programming this in node.
I'm not sure if code is needed, since the problem is probably has nothing to do with the code itself.
For those who are interested:
...ANSWER
Answered 2021-Jan-24 at 12:32So, I managed to understand what was going on, (thanks to a packet sniffing tool called wireshark), it was basically a typical case of an encoding problem. For the ftp clients, what was going on is basically ftp only receives latin-1 encoding, but node converts it to utf8 behind the scenes. So for example my terminal was set to utf-8, so it kept sending utf-8 messages to the the latin-1 server, which of course it didn't know how to interpret.
But I discovered a command (in unix) that allows you to convert utf-8 to latin-1, and you use use it like this on the terminal
>luit -encoding ISO-8859-1 ftp
this translates utf-8 to latin-1, and then it succeeded in listing the file.
Now for the case in node-js, the only thing I had to do was to stop node-js from converting the string to UTF-8, and to convert it to latin-1 instead. the Library however had hardcoded the utf-8 string, so, I had to options, modify the library or search for an alternative that supports such encoding.
Surprisingly, I had to do the later one, since I didn't have luck on finding another ftp library, I had the good fortune of finding @icetee/ftp
, which is a fork of the original ftp package. Basically I had to make a fork and modify this line. And now everything works for my server, hopefully, there will be a setting on the future for this package. And that's how I solved it.
QUESTION
In my nodejs code I am using ssh2-sftp-client (https://github.com/theophilusx/ssh2-sftp-client) to transfer some files to a remote server :
The files in my directory are like :
...ANSWER
Answered 2021-Jan-18 at 14:48Worked with version 6.0.0 of ssh2-sftp-client
QUESTION
As far as I know, everything about the Internet is (or rather should be?) defined and documented in the RFCs. I found a listing of several HTTP-headers on mozilla.org (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers), which I assumed to be second-hand knowledge taken from the RFCs. However most of the security-related HTTP-headers are neither in the RFCs (source: https://www.rfc-editor.org/search/rfc_search_detail.php?title=Content-Security-Policy) nor in the HTTP-headers suggested by IANA (source: https://www.iana.org/assignments/message-headers/message-headers.xhtml)
- Is there a commitee that decides on such conventions and a central place where I can always find first-hand information about the rules of the internet?
- How do programmers of critical applications know which features they have to implement to keep their software up-to-date with the rest of the internet?
- How can programmers be sure their software is implemented perfectly according to the rules and works in harmony with the rest of the internet. E.g. somebody who programs an FTP-client (assuming they are not making use of libraries) has to make sure their understanding of the FTP-protocol is the same as that of every single FTP-server-application, right?
ANSWER
Answered 2020-Dec-31 at 01:58The RFCs stand as a final approved documentation. In your case the HTTP is under the HTTP Working Group so some new features which some browsers already support are being discussed in this group. Expanding the idea, some security headers present in HTTP may be from other groups and just referenced in HTTP RCFs. The Content Security Policy is documented in the RFC 7762 not that it's tagged as informational.
Each area has its Working groups, in this case HTTP is nested in ART (Applications And Real-Time Area). Each of those groups compile, revise and publish new specifications. As an example you can see HTTP(httpbis) charter
There's two options, implement based on the RCFs and its references or follow the Working Group directives and references. Using only RFCs is more secure and interoperable but will eventually be outdated until a new RFC is published.
The only way is to implement what is documented under the RFCs. It's part o the internet concept, new features or standards will take a while to be fully documented and it's up to developer research and implement those.
QUESTION
I have a Node API deployed to Google CloudRun and it is responsible for managing external servers (clean, new Amazon EC2 Linux VM's), including through SSH and SFTP. SSH and SFTP actually work eventually but the connections take 2-5 MINUTES to initiate. Sometimes they timeout with handshake timeout errors.
The same service running on my laptop, connecting to the same external servers, has no issues and the connections are as fast as any normal SSH connection.
The deployment on CloudRun is pretty standard. I'm running it with a service account that permits access to secrets, etc. Plenty of memory allocated.
I have a VPC Connector set up, and have routed all traffic through the VPC connector, as per the instructions here: https://cloud.google.com/run/docs/configuring/static-outbound-ip
I also tried setting UseDNS no
in the /etc/ssh/sshd_config file on the EC2 as per some suggestions online re: slow SSH logins, but that has not make a difference.
I have rebuilt and redeployed the project a few dozen times and all tests are on brand new EC2 instances.
I am attempting these connections using open source wrappers on the Node ssh2 library, node-ssh and ssh2-sftp-client.
Ideas?
...ANSWER
Answered 2020-Dec-12 at 21:23Cloud Run works only until you have a HTTP request active.
You proably don't have an active request during this on Cloud Run, as outside of the active request the CPU is throttled.
Best for this pipeline is Cloud Workflows and regular Compute Engine instances.
You can setup a Workflow to start a Compute Engine for this task, and stop once it finished doing the steps.
I am the author of article: Run shell commands and orchestrate Compute Engine VMs with Cloud Workflows it will guide you how to setup.
Executing the Workflow can be triggered by Cloud Scheduler or by HTTP ping.
QUESTION
I need to test a function that write a file from local path to remote path on an sftp machine using shh2-sftp-client library.
my own function is the following:
...ANSWER
Answered 2020-Nov-14 at 21:39I hope it will be useful to others, but I have found the solution. I always defined the mock by default, but then I invoked the mockImplementation() method on the instance of the ssh2-sftp-client library class, mocking the single functions. For each test I overwrite the return value of each function.
Here an example:
QUESTION
I work on a FTP script for a mbed project. I work with the B-L475E-IOT01A development board and try to send a file to a FTP-Server. Therefore I cant establish a connection with the server with this libary https://os.mbed.com/users/dkato/code/ftp-client/#e069c405c934. Unfortunaly the client doesnt work like it should work. I try to establish connection like this:
...ANSWER
Answered 2020-Nov-10 at 22:20Julien, all the responses from the server follow a pattern.. you need to wait for a \r\n
sequence from the server. You need to filter TELNET protocol escape sequences (that start with the byte 0xff or 0xfe, I don't remember from my head) and the codes must be always at the beginning of a line. Also the numbers with a -
instead of a space indicate that the message is larger and you should expect another line (the last line of each message has a numeric code followed by a space)
This is essential to maintain yourself synchronized with the server.... or you'll start receiving responses to different commands than the one you think.
From the output it is not clear what you try to do, as the only thing you show is the login part to the server.
Your command lines also have (this is mandatory by the protocol) to end in a sequence \r\n
(in that order) you cannot do else, or you can reach a server that doesn't understand you.
Check RFC-959 - File Transfer Protocol for details on how the ftp protocol works. The transfers are normally handled in a new, different TCP connection, so you normally have to manage the control connection plus a series of data transfers that run in parallel with it.
QUESTION
I am new to Java Spring. I am following a tutorial regarding Mock FTP server( https://www.baeldung.com/java-ftp-client )
This demo has a Maven dependency. However, how can I build it using gradle ?(http://mockftpserver.sourceforge.net/index.html)
...ANSWER
Answered 2020-Sep-28 at 18:56Simply search the dependency on google or go to https://mvnrepository.com/artifact/org.mockftpserver/MockFtpServer/2.7.1 and click under gradle tab.
Meanwhile, to answer your question, this should work
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ftp-client
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page