Upload Intent Broken?

FTP client for Android handsets.
Post Reply
alfred
Posts: 1
Joined: Tue Jun 26, 2012 8:19 pm
AntiSpam sum: 8

Upload Intent Broken?

Post by alfred »

I am trying to use an upload intent on a Samsung Galaxy Tab with Android 3.2. AndFTP is V 2.9.9.2. The resulting TRANSFERSTATUS is UNKNOWN.

The dialog shown does not look correct, and is attached. The code I am using is from an example and is shown below.

What am I doing wrong?


------------------------------------------------


//You have to define a FTP server URL and upload command:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
Uri ftpUri = Uri.parse("ftp://192.168.112.11");
intent.setDataAndType(ftpUri, "vnd.android.cursor.dir/lysesoft.andftp.uri");
intent.putExtra("command_type", "upload");

//You can add FTP credentials:
intent.putExtra("ftp_username", "anonymous");
intent.putExtra("ftp_password", "test");
//intent.putExtra("ftp_keyfile", "/sdcard/rsakey.txt");
//intent.putExtra("ftp_keypass", "optionalkeypassword");;

//Setup optional FTP preferences:
intent.putExtra("ftp_pasv", "true");
//intent.putExtra("ftp_resume", "true");
//intent.putExtra("ftp_encoding", "UTF-8");

//And define file(s) to upload and optional remote folder:
intent.putExtra("local_file1", "/sdcard/results.log");
intent.putExtra("local_file2", "/sdcard/file2.zip");
// Optional initial remote folder (it must exist before upload)
intent.putExtra("remote_folder", "/tmp");

//Finally start the Activity:
startActivityForResult(intent, UPLOAD_FILES_REQUEST);
Attachments
andftp.png
andftp.png (6.33 KiB) Viewed 4714 times

support
Posts: 853
Joined: Sun Apr 20, 2008 4:40 pm

Re: Upload Intent Broken?

Post by support »

Are you sure anonymous/test user is allowed on FTP server? And has write permissions?

Post Reply