Hi,
We have a cloud based apllication, there is a facility called image upload where user can select an image file from his local drive and save that file to a shared folder which is not in user's network. The code with I have written works for shared folder in network but outside the network it fails.
Currently I am passing path which has IP address of shared folder's computer and shared folder name attached to IP address. I think I need to pass username and password also with IP address.
What I have done is
- string FileName ="Image1.jpg";
- string Root = @"" + "IPAddress\\SharedFolderName" + '\\' + CustID;
-
- if (!Directory.Exists(Root))
- {
- Directory.CreateDirectory(Root);
- }
-
- string filePath = Root + "\\" + FileName;
-
- File.WriteAllBytes(filePath, Convert.FromBase64String(image));
- \\ Here "image" is file content which I want to save in shared folder.
This code is running for shared folder in network. But to access folder in other network I think I have to pass username and password.
How to do that in c#?
Any help would be appreciated. Thank you.