Reputation: 111
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
The problem is that in the line:
Buffin = new BufferedInputStream (new FileInputStream (file));
I can not put any paths in "file", eclipse does not validate any values or path-
What would have to indicate in "new FileInputStream"?
I do not know I'm doing wrong.
Thank you very much and best regards
Upvotes: 1
Views: 1437
Reputation: 2570
You can do this:
Buffin = new BufferedInputStream (new FileInputStream (<path to your file>));
Details here: FileInputStream
Upvotes: 1
Reputation: 57702
You need a File
object to pass it to the FileInputStream
.
Buffin = new BufferedInputStream(new FileInputStream(new File("/path/to/file"));
And you can't Upload file to FTP
because FTP is not a place, it is a protocol.
Upvotes: 2