ftp-client

Using FTP's mget without prompts

末鹿安然 提交于 2020-04-07 02:23:09
问题 I am trying to pulls some files down from a server using the FTP protocol. I have not problems accessing the files and downloading them. The issues is there are a number of them and the command, mget *.raw I am being prompted to download the file as follows mget G20140926_Plasma_iTRAQTMTstudy_TMT10_fr12.raw? y 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for G20140926_Plasma_iTRAQTMTstudy_TMT10_fr12.raw (1658613609 bytes). 226 Transfer complete.

Recursive upload to FTP server in C#

北战南征 提交于 2020-04-05 05:28:27
问题 I would need to upload a folder (which contains sub folders and files) from one server to another from C# code. I have done few research and found that we can achieve this using FTP. But with that I am able to move only files and not the entire folder. Any help here is appreciated. 回答1: The FtpWebRequest (nor any other FTP client in .NET framework) indeed does not have any explicit support for recursive file operations (including uploads). You have to implement the recursion yourself: List

How to list all subdirectory using nodeJS SFTP client?

拥有回忆 提交于 2020-03-02 11:59:06
问题 Amusing node JS ssh2-sftp-client. I want to the list all the directory and its subdirectories in a given path? let sftp = new ssh2SftpClient(); console.log(sftp); sftp.connect({ host: 'xx.xxx.xxx.xxx', port: '22', username: 'centos', privateKey: require('fs').readFileSync('/home/myHome/aws_int.ppk') }).then(() => { return sftp.list('/home/centos/myHome'); }).then((data) => { console.log('the data info : ' + data); for(i = 0; i < data.length; i++) { console.log(data); console.log(data[i].name)

I have a “could not connect to host” Logcat message while trying to connect to FTP server, what am I doing wrong?

岁酱吖の 提交于 2020-01-25 02:55:27
问题 I'm developing an application on Android that connects to a FTP server to upload and download files. To make the connection I'm using the apache commons-net library's FTPClient class based on this and I'm working on Eclipse. But I get the following message on my Logcat: 07-04 21:11:44.196: D/USB Virtual(14708): Error: could not connect to host ftp://xxx.xxx The following is my manifest permissions: <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE

Can't download files with Arabic name with Java FTP client

十年热恋 提交于 2020-01-21 09:37:36
问题 I have Java code that connects to an FTP server and downloads files. If the file name contains Arabic letters, then it always fails to download. But if it's English, it downloads successfully. This is my code. If the path is like this then it fails to download: String actualFileLocation = "/RelatedDocumentUploads\\...\\2017-S2\\تقرير الربع الرابع تقرير 2017 (006)senton(18-01-2017).pdf" ; But if it's like the following it works fine: String actualFileLocation = "/RelatedDocumentUploads\\...\

SFTP connection with FTPSClient is failing

二次信任 提交于 2020-01-11 08:00:30
问题 Below code I'm trying to connect SFTP host using FTPSClient . Instead of FTP client, I'm using FTPSClient to connect. But I'm facing issue to connect. public static void main(String[] args) throws SocketException, IOException { String host ="sftphost.com"; String user = "abc"; String pwd = "pwd" final FTPSClient ftp = new FTPSClient(); System.out.println("host:"+host); ftp.connect(host,22); int reply = ftp.getReplyCode(); ftp.login(user, pwd); } 回答1: FTPS is not SFTP. You cannot use Apache

How to preserve date modified when retrieving file using Apache FTPClient?

蓝咒 提交于 2020-01-11 05:59:28
问题 I am using org.apache.commons.net.ftp.FTPClient for retrieving files from a ftp server. It is crucial that I preserve the last modified timestamp on the file when its saved on my machine. Do anyone have a suggestion for how to solve this? 回答1: This is how I solved it: public boolean retrieveFile(String path, String filename, long lastModified) throws IOException { File localFile = new File(path + "/" + filename); OutputStream outputStream = new FileOutputStream(localFile); boolean success =

Files are getting corrupted via FTP Client Upload

谁说胖子不能爱 提交于 2020-01-06 19:49:16
问题 I tried uploading files to my server my.php (normal local file) <?php $box_title= "SEARCH ME" ?> After uploading via FileZilla FTP Client (remote server file) // SOMETIMES ABOVE FILE BECOMES <?php$box_title= "SEARCH ME"?> // OR SOMETIMES LIKE THIS <?php $box_title= "SEARCH ME" ?> I suspect this is a server related issue, but not sure. Can anyone explain this problem with solution Thanks 回答1: An above comment already suggested looking at ASCII/binary mode. It's a weird property of FTP that

How to set working directory on FTPusing FTPClient

我是研究僧i 提交于 2020-01-03 05:35:09
问题 I'm using java FTPClient for FTPconnection. This library has storeFile method for saving a file on FTP. I use it like this: FTPClient ftpClient = new FTPClient(); //code for connection and login ... ftpClient.storeFile("test.jpg", stream); //stream is an InputStream Now, I need to set working directory on FTP. For example I want to save my .jpg in the specific folder. Is ftpClient.storeFile("1/test.jpg", stream); correct? Or is there another solution? 回答1: I think you should call FTPClient