Programer OZ Posted July 9, 2010 Share Posted July 9, 2010 I have a page where users can submit text. How do I make the C# code save to the website (a .txt file) to a certain folder. When I ran my website from home it was like this... writer= new StreamWriter(@"\iFrameContents\codeSnippets\snippetsList.list"); writer.WriteLine(temp + authorName.Text + "-" + codeName.Text + " " + id.ToString()); writer.Close(); *thats just a small part of it.. the part that writes the new submission name to the list of submitted texts, thus the ".list" extension on the file, but it is still in plain text. **the other part makes a file with that name and writes the text inside it. that is the one with the ".txt" extension Since I do not have rights to the file system (i think) I can't do it like that here. Thanks! Quote Link to comment Share on other sites More sharing options...
Wizard Posted July 9, 2010 Share Posted July 9, 2010 I am unfamiliar with C#. However, you have write permissions to your files. You should be able to set write permissions through the file manager. Quote Link to comment Share on other sites More sharing options...
Programer OZ Posted July 9, 2010 Author Share Posted July 9, 2010 I am unfamiliar with C#. However, you have write permissions to your files. You should be able to set write permissions through the file manager. well thats good, once my website is up I'll test if i can write. Thanks! Quote Link to comment Share on other sites More sharing options...
Programer OZ Posted July 19, 2010 Author Share Posted July 19, 2010 I am unfamiliar with C#. However, you have write permissions to your files. You should be able to set write permissions through the file manager. My url is http://oz.heliohost.org/. If I want to make a file in http://oz.heliohost.org/Programming/IFrame...s/codeSnippets/ what path would i use? I need a drive and folder path, something like C:/heliohost/users/oz/Programming/IFrameContents/codeSnippets/. Do you know what the path would be? Quote Link to comment Share on other sites More sharing options...
Byron Posted July 20, 2010 Share Posted July 20, 2010 Your path would look like this: /home/oz/public_html/Programming/IFrameContents/codeSnippets/ Quote Link to comment Share on other sites More sharing options...
Programer OZ Posted July 20, 2010 Author Share Posted July 20, 2010 Your path would look like this: /home/oz/public_html/Programming/IFrameContents/codeSnippets/ I think I can't use that. I need the whole deal, including the drive letter. This is because if I use /home/oz/public_html/Programming/IFrameContents/codeSnippets/ from oz.heliohost.org/programming/Home... if will save to oz.heliohost.org/programming/Home/home/oz/public_html/Programming/IFrameContents/codeSnippets/ So I need the whole path so i can save to the same place always. Quote Link to comment Share on other sites More sharing options...
Byron Posted July 20, 2010 Share Posted July 20, 2010 That is the complete path but you don't have to use the complete path. Is that what your wanting to do is append those urls together? Whatever your doing just use relative paths and remove the parts you don't need. /home/oz/public_html/Programming/IFrameContents/codeSnippets/ from oz.heliohost.org/programming/Home... if will save to oz.heliohost.org/programming/Home/home/oz/public_html/Programming/IFrameContents/codeSnippets/ Quote Link to comment Share on other sites More sharing options...
Programer OZ Posted July 20, 2010 Author Share Posted July 20, 2010 That is the complete path but you don't have to use the complete path. Is that what your wanting to do is append those urls together? Whatever your doing just use relative paths and remove the parts you don't need. /home/oz/public_html/Programming/IFrameContents/codeSnippets/ from oz.heliohost.org/programming/Home... if will save to oz.heliohost.org/programming/Home/home/oz/public_html/Programming/IFrameContents/codeSnippets/ No I want to save to a folder, if I don't have a drive letter it wont work right. I just need a full path. other wise I'll have to resort to FTP uploads and downloads to save and read data. FTP Would just be pain in the butt. Quote Link to comment Share on other sites More sharing options...
Wizard Posted July 20, 2010 Share Posted July 20, 2010 The server runs on Linux. There's no such thing as a "drive letter" in a Linux file system. Quote Link to comment Share on other sites More sharing options...
Byron Posted July 20, 2010 Share Posted July 20, 2010 Looks like you need to add a line break so your urls are seperated. I have know idea how you do it with C# but with php you just add it like this: "oz.heliohost.org/Programming/IFrameContents/codeSnippets/\n\n" "oz.heliohost.org/programming/Home/\n\n" Quote Link to comment Share on other sites More sharing options...
Programer OZ Posted July 20, 2010 Author Share Posted July 20, 2010 Well I guess I will use FTP then. Thanks guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.