user523791
user523791

Reputation: 69

Open a file in a shared folder in cocoa

I am trying to open a pdf file residing in a windows shared folder from my cocoa application.

I am trying to use the NSWorkSpace openFile method to open the file and I am passing a path similar to @"smb:\192.168.2.1\sharedFolderName\my.pdf.

However I am unable to open the file. Do I have to mount the shared folder before opening the file ?

Upvotes: 0

Views: 450

Answers (1)

arainchi
arainchi

Reputation: 1482

Proper URL for shared folder is

smb://[[domain;]username[:password]@]server[/share[/path]]

So in your example it should be

@"smb://192.168.2.1/sharedFolderName/my.pdf"

Upvotes: 1

Related Questions