Is there any possibility that
onActivityResult(int requestCode, int resultCode, Intent data)
can be called with resultCode or data?
At this time I have no way of knowing if the xfer(upload) worked?
Thanks for a great product
-Brian
- "close_ui" support added to Intent to close Activity after transfer.
- TRANSFERSTATUS string available in returned Intent
Values can be: UNKNOWN, COMPLETED, FAILED, CANCELLED.
If anyone has any ideas.. I've implemented this code, the FTP connection/handshake seems to happen without issue. However, I am seeing the activity showing the progress, but it's not giving uploading information back, all of the activity's defaults are staying set to their defaults (read: blank).
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
// FTP URL (Starts with ftp://, sftp:// or ftps:// followed by hostname and port).
Uri ftpUri = Uri.parse("ftp://mysite.com:21");
intent.setDataAndType(ftpUri, "vnd.android.cursor.dir/lysesoft.andftp.uri");
// FTP credentials (optional)
intent.putExtra("ftp_username", "username");
intent.putExtra("ftp_password", "password");
//intent.putExtra("ftp_keyfile", "/sdcard/dsakey.txt");
//intent.putExtra("ftp_keypass", "optionalkeypassword");
// FTP settings (optional)
intent.putExtra("ftp_pasv", "true");
//intent.putExtra("ftp_resume", "true");
//intent.putExtra("ftp_encoding", "UTF8");
// Upload
intent.putExtra("command_type", "upload");
// Activity title
intent.putExtra("progress_title", "Uploading file ...");
intent.putExtra("local_file", "/sdcard/myproject/test.zip");
//intent.putExtra("local_file2", "/sdcard/subfolder2/file2.zip");
// Optional initial remote folder (it must exist before upload)
intent.putExtra("remote_folder", "/test/ftp/Android");
startActivityForResult(intent, 1);
I tried uploading the same local on phone file to the same location on the FTP server through the UI in AndFTP and it works fine! I double checked each line, username, password, etc., all matches. yet in my Android 2.1 application this is just not working. Surely this is something simple I'm overlooking?
If anyone has gotten this to work can you please explain what issues you overcame to get this working. Time is against me on this one and I need to find a solution as soon as possible.
If you have a working example that would be most helpful.
I believe I thought at first I could change the name of that arguement, but I never changed it back when I was doing my testing. Ah, nothing like hours wasted on a simple to fix issue. At least my project is working properly and now I can go beyond my test code.