【问题标题】:How do you upload images to an FTP server within an Android app?如何在 Android 应用程序中将图像上传到 FTP 服务器?
【发布时间】:2011-09-21 19:25:33
【问题描述】:

是否可以将图像从我的 Android 应用程序上传到 FTP 服务器?图像将已使用相机拍摄。

在桌面应用程序中,我们会使用 FTP 客户端将任何文件/图像上传到实时服务器。我们如何在我们的 Android 应用程序中做类似的事情?

【问题讨论】:

    标签: android file-upload ftp


    【解决方案1】:

    使用它对我来说很好用......

    SimpleFTP ftp = new SimpleFTP();
    
    
                    // Connect to an FTP server on port 21.
                    ftp.connect("server address", 21, "username", "pwd");
    
                    // Set binary mode.
                    ftp.bin();
    
                    // Change to a new working directory on the FTP server.
    
    
                    ftp.cwd("path");
    
                    // Upload some files.
                    ftp.stor(new File("your-file-path"));              
    
                    // Quit from the FTP server.
                    ftp.disconnect();
    

    更多信息和 jar ...http://www.jibble.org/simpleftp/

    【讨论】:

      猜你喜欢
      • 2017-06-09
      • 1970-01-01
      • 2020-12-25
      • 2017-06-11
      • 1970-01-01
      • 1970-01-01
      • 2018-09-27
      • 1970-01-01
      • 2017-08-27
      相关资源
      最近更新 更多