Reputation: 5377
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
Reputation: 130102
I believe the correct URI with username & password is:
@"smb://WORKGROUP;USERNAME:PASSWORD@windowssever/d$/myfolder/myfile.csv"
Upvotes: 2