上传文件到FTP [英] Upload file to FTP

查看:213
本文介绍了上传文件到FTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将文件上载到使用Apache FTP的FTP。
我使用的是code,我已经看到了几个网站,包括计算器

I'm trying to upload a file to an FTP using apache commons ftp. I am using a code that I have seen on several websites, including stackoverflow

Android的FTP库

的问题是,在该行:

Buffin = new BufferedInputStream (new FileInputStream (file));

我不能把任何路径中的文件,日食不会验证任何值或路径 -

I can not put any paths in "file", eclipse does not validate any values ​​or path-

你会在新的FileInputStream来表示?

What would have to indicate in "new FileInputStream"?

我不知道我做错了。

非常感谢你和问候

推荐答案

您需要一个文件对象将其传递给的FileInputStream

You need a File object to pass it to the FileInputStream.

Buffin = new BufferedInputStream(new FileInputStream(new File("/path/to/file"));

,你不能上传文件,FTP 因为FTP不是一个地方,它是一个协议。

And you can't Upload file to FTP because FTP is not a place, it is a protocol.

这篇关于上传文件到FTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆