Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Writing to/creating a file in remote server

Writing to/creating a file in remote server

Scheduled Pinned Locked Moved C#
csharpquestionasp-netsysadminwindows-admin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    emran834
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • E emran834

      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

      L Offline
      L Offline
      LongRange Shooter
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups