Writing to/creating a file in remote server
-
Hi all, When I use the following code in my C# Windows application, it works well. File.WriteAllText(MapPath(@"softUser_log\log.txt"), "abcd"); But, I want to do the same thing in ASP.NET and I m hosting my files in a remote server "lunarpages" where they use PLESK. Now, When I execute the mentioned code, i dont see that file has been created and written to it. Do I need to log in PLESK and manually change any permission ? If so, what is the permission should be. I was familiar with Linux and Unix where I used to set permission 777 to a Folder to create or delete file from it, 666 to a file to write on it. But in PLESK, i got very confused, becasuse in Permission area, i saw "user name, IIS domain...etc..etc.... " Can anyone help me please,. Thanks and regards
-
Hi all, When I use the following code in my C# Windows application, it works well. File.WriteAllText(MapPath(@"softUser_log\log.txt"), "abcd"); But, I want to do the same thing in ASP.NET and I m hosting my files in a remote server "lunarpages" where they use PLESK. Now, When I execute the mentioned code, i dont see that file has been created and written to it. Do I need to log in PLESK and manually change any permission ? If so, what is the permission should be. I was familiar with Linux and Unix where I used to set permission 777 to a Folder to create or delete file from it, 666 to a file to write on it. But in PLESK, i got very confused, becasuse in Permission area, i saw "user name, IIS domain...etc..etc.... " Can anyone help me please,. Thanks and regards
I'm not clear as to where you code is sitting and where your file needs to be saved. However your URI name is incorrect if you plan to save it to a remote server. You have to make the name: \\server\share\path....\filename to do any kind of save across a network to a server. If your application is on a server and you are saving the file ON THAT SERVER, then you need to do two things: 1) make certain your folder is created prior to executing your code 2) make certain you have given JUST THAT FOLDER write permissions. This is from the IIS point of view. As to PLESK, never heard of it and don't know what you have to do. You may have to get technical support from the lunarpages webmaster instead of us.