I'm trying to download from ftp server in my android app but when i create the local file i can't write in.
Here the code:
String servidor = ips[0];
int reply;
ftp.setDataTimeout(1000);
ftp.connect(servidor);
ftp.login(usuaris[0], pass[0]); // ftp.login( username password)
//ftp.changeWorkingDirectory(".");
ftp.setFileType(FTP.ASCII_FILE_TYPE);
File file = new File("resultat.txt");
FileOutputStream fos = new FileOutputStream(file);
ftp.retrieveFile("ARTI.txt", fos);
fos.close();
And when i do this
FileOutputStream fos = new FileOutputStream(file);
i have this exception:
java.io.FileNotFoundException: resultat.txt: open failed: EROFS (Read-only file system)