Jump to content

User Submitting


Recommended Posts

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!

Link to comment
Share on other sites

  • 2 weeks later...
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?

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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/

 

Link to comment
Share on other sites

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. :wacko:

Link to comment
Share on other sites

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"

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...