是否可以获取远程服务器来测试上传文件功能?

时间:2013-02-02 15:01:44

标签: file-upload ftp

我有一个下面显示的simle程序,可以将文件上传到远程位置

 public static void main(String[] args) {
    String server = "www.myserver.com";
    int port = 21;
    String user = "user";
    String pass = "pass";
    FTPClient ftpClient = new FTPClient();
    try {
        ftpClient.connect(server, port);
        ftpClient.login(user, pass);
        ftpClient.enterLocalPassiveMode();
        ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
        File firstLocalFile = new File("D:/Test/Projects.zip");
        String firstRemoteFile = "Projects.zip";
        InputStream inputStream = new FileInputStream(firstLocalFile);
        System.out.println("Start uploading first file");
        boolean done = ftpClient.storeFile(firstRemoteFile, inputStream);
        inputStream.close();

}

我的问题是,无论如何都可以测试这个程序,因为我目前没有远程服务器。

意味着可以让远程服务器上传文件用于临时目的(对不起,但只有开源请)

有人知道这些网站吗?

屏幕截图

enter image description here

0 个答案:

没有答案