|
-
Jul 7th, 2003, 09:21 AM
#1
Thread Starter
Hyperactive Member
File IO in ASP.NET
Hey,
I need to save a file to the server. The standard file io code doen't work.
Please Help Me!
-
Jul 7th, 2003, 10:04 AM
#2
PowerPoster
Sure it does.
You need to grant permission to the folder you are trying to write 2.
-
Jul 7th, 2003, 02:17 PM
#3
Thread Starter
Hyperactive Member
can you post some example code
mine (even after perm.) wont work..got it to work with windows forms only
-
Jul 7th, 2003, 03:01 PM
#4
PowerPoster
Here a code snippet I use on one of my pages to bind to a datalist control. I read in my image files from a directory within my web application:
NOTE: Saving works the same way
Code:
private void LoadPostImages()
{
string dir = Server.MapPath(ActiveUser.PathToPostImages);
foreach (string img in Directory.GetFiles(dir, "*.gif")) {
rblPostImages.Items.Add(new ListItem("<img border=0 align=absmiddle src=" + dir + Path.GetFileName(img) + "> ", Path.GetFileName(img)));
}
rblPostImages.Items.Insert(rblPostImages.Items.Count, new ListItem("none", ""));
rblPostImages.SelectedIndex = rblPostImages.Items.Count - 1;
}
Last edited by Lethal; Jul 7th, 2003 at 03:10 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|