TSCAmerica.com
TSCAmerica.com

Reputation: 5377

Share Files Between my iPad App and PC using objectiveC

My ipad app creates a CSV file that I want to copy into a windows pc at smb://windowssever/d$/myfolder.

My Windows PC needs an authetication that is it needs a username and password to connect.

I am using the following code to copy but not sure where should I give the username and password of PC in the following code.

NSFileManager *filemgr;
filemgr = [NSFileManager defaultManager];
if ([filemgr copyItemAtPath: @"/tmp/myfile.csv" toPath: @"smb://windowssever/d$/myfolder/myfile.csv" error: NULL]  == YES)
        NSLog (@"Copy successful");
else
        NSLog (@"Copy failed");

Upvotes: 2

Views: 1485

Answers (1)

Sulthan
Sulthan

Reputation: 130102

I believe the correct URI with username & password is:

@"smb://WORKGROUP;USERNAME:PASSWORD@windowssever/d$/myfolder/myfile.csv"

Upvotes: 2

Related Questions