Questions tagged [ftp-client]

is for questions dealing with the clients used for the file transfer protocol.

FTP, or File Transfer Protocol, is a way of exchanging files over a network. It uses a client-server architecture with dual connections between them; one for control and one for data.

FTP Wikipedia Article

732 questions
4
votes
1 answer

fileSystem to FTPFile[]?

I simply want to know if there is a way to mock an array of FTPFile. I am trying to pass as a parameter a fake FTPFile[] to the function I want to test: protected void indexFolder(FTPClient, FTPFile[], File, FTPFolderAssetSource); I am using…
plog17
  • 832
  • 8
  • 23
4
votes
0 answers

.Net 6: Correct way to create a FtpWebRequest-object

In C# using .Net6 we can interact with an FTP-server using an FtpWebRequest-object. This works well. But how should we create this object? Currently we use WebRequest.Create() and Microsoft says we should do exactly this. But this function is…
anion
  • 1,516
  • 1
  • 21
  • 35
4
votes
3 answers

Uploading a file to testcontainer FTP server fails with Connection refused after being connected

I'm working with FTPClient against an FTP server using Testcontainers. A reproducible code sample is here: import org.apache.commons.net.PrintCommandListener; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import…
orirab
  • 2,915
  • 1
  • 24
  • 48
4
votes
4 answers

0 kb file created once FTP is done in java

I am trying to FTP a file on to a remote machine. Below is my code :- FTPClient ftpClient = new FTPClient(); ftpClient.connect("home.abc.com"); ftpClient.login("remote", "guesst12"); int replyCode = ftpClient.getReplyCode();…
M.J.
  • 16,266
  • 28
  • 75
  • 97
4
votes
5 answers

FTPClient (commons net) Upload problem

I use the following piece of code to upload a photo to a ftp host. But the photo seems to be corrupted after being uploaded: There are narrow gray lines at the bottom of the photo. The size of gray lines could be decreased by decreasing the Buffer…
ehsun7b
  • 4,796
  • 14
  • 59
  • 98
4
votes
5 answers

connect to ftps site via java

I am trying to connect to a clients ftps server via my java code. I am using apache commons library to do so. However, I am not able to do so. Can anyone please help me with this. The client server uses FTPS/Implicit SSL connection and uses Passive…
Vivek
  • 957
  • 4
  • 12
  • 18
4
votes
4 answers

Chrome OS: how to enable direct SFTP access in the Files app / Pixelbook Review

An article on Chrome OS that I read here: https://medium.com/@JamesCridland/review-five-months-with-a-chromebook-for-web-development-writing-and-more-8adf36b4a061 says: "Update: Above, I mention that I use SSH and vi to do my programming work.…
4
votes
2 answers

Unable to connect to ftp server java

I should be able to successfully send and receive file to/from FTP server. But then, no changes occurred in the code and I started getting this : Error: java.net.ConnectException: Connection timed out: connect What I am doing is: FTPClient ftp =…
Sagar
  • 1,727
  • 4
  • 22
  • 30
4
votes
1 answer

How to properly unit test a class that gets file from an FTP server

In fact, my question is divided into two parts. How do I isolate my test from outside but still make sure that the functionality works? How can I mock the apache commons FtpClient class using Mockito? When I mock it, I get null at: InputStream…
Mikayil Abdullayev
  • 12,117
  • 26
  • 122
  • 206
4
votes
3 answers

Run Atom editor as root in FileZilla for view/edit files

I know how to open/edit files from the server in FileZilla. I set up this: /usr/bin/atom in edit -> settings -> file editing But the problem is that it opens the file in non-root Atom mode. How to open file in Atom editor as root?
Asymetriko
  • 41
  • 1
  • 4
4
votes
1 answer

how can play media from ftpserver without download it in android?

i wanted to play music and video file from ftpserver,i don't like to download it and after that play it, i just play without download like url address use in MediaPlayer class. mediaPlayer = new…
4
votes
1 answer

FTPClient and BufferedReader

So I am having this code that should read from every line from every text document in an ftp directoy, the thing is that is only works for det first file because when it comes to the second I can see in the log that the second also gets listed but…
Emilio Gaines
  • 95
  • 1
  • 10
4
votes
1 answer

Too many FTP connections, can't accept more

I got the following error message: Warning: ftp_login(): I can't accept more than 6 connections as the same user in C:\xampp\htdocs\test\ftp_sync.php on line 58 My code which causes the error: function newStream($i){ $conId =…
piyaphorn
  • 51
  • 1
  • 4
4
votes
3 answers

Calculate file checksum in FTP server using Apache FtpClient

I am using FtpClient of Apache Commons Net to upload videos to FTP server. To check if the file has really been successfully transferred, I want to calculate the checksum of remote file, but unfortunately I found there is no related API I could use.…
Alvis
  • 109
  • 3
  • 13
4
votes
4 answers

copy file from one server to another programmatically in php

I've hosted my all code files on one server whose domain is like example.com and I'm at one of those html pages. I want some files of example.com to move on another server whose domain is like example2.com. I've searched through Internet but I…
Tabassum Ali
  • 43
  • 1
  • 1
  • 6