Awais Tariq
Awais Tariq

Reputation: 7754

Make SmbFile from Android SDCard

I need to access the android SDCard file to copy it to the windows shared folder. I'm unable to make SMBFile from Android SDCard. Currently I'm using this:

    SmbFile smbFile_Source = new SmbFile("smb:///mnt/sdcard/abc.jpg");

    smbFile_Source.length();

    SmbFile smbFile_dest = new SmbFile("smb://192.x.x.x/folder/abc.jpg", authentication);

    smbFile_Source.copyTo(smbFile_dest);

The destination smbfile is working fine..Only I can't make file from Android SDcard.. Thanks

Upvotes: 0

Views: 1467

Answers (1)

tantonj
tantonj

Reputation: 444

you will probably have to make the source file a File object not an smb object, then use an input and output stream to save your file to the smb file location

Copying file from a Samba drive to an Android sdcard directory

Upvotes: 1

Related Questions