Click here to Skip to main content
15,900,424 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: image problem in datalist Pin
Christian Graus30-Jun-08 12:32
protectorChristian Graus30-Jun-08 12:32 
GeneralRe: image problem in datalist Pin
wajans1-Jul-08 6:06
wajans1-Jul-08 6:06 
AnswerRe: image problem in datalist Pin
wajans1-Jul-08 6:10
wajans1-Jul-08 6:10 
QuestionASP. Net AJAX, Response.Write, and PDF Pin
Ariel Kazeed30-Jun-08 3:19
Ariel Kazeed30-Jun-08 3:19 
AnswerRe: ASP. Net AJAX, Response.Write, and PDF Pin
Christian Graus30-Jun-08 10:54
protectorChristian Graus30-Jun-08 10:54 
QuestionSpellCheck Error Pin
rockram30-Jun-08 3:18
rockram30-Jun-08 3:18 
AnswerRe: SpellCheck Error Pin
Christian Graus30-Jun-08 11:00
protectorChristian Graus30-Jun-08 11:00 
QuestionAccess denied to folder in ASP.NET project either though I have granted all users full permissions !! Pin
truegilly30-Jun-08 2:48
truegilly30-Jun-08 2:48 
Hello,

i have made a very simple file upload app, that i want users to be able to upload images to a folder on my server, well localhost for the time being Laugh | :laugh:

here is the simple upload code...



protected void ButtonRegisterDetails_Click(object sender, EventArgs e)
{
    // display properties of the uploaded file
    String FileName = MyFile.PostedFile.FileName;
    String FileContent = MyFile.PostedFile.ContentType;
    int FileSize = MyFile.PostedFile.ContentLength;

    // get just the file name
    String justFileName = Path.GetFileName(FileName);

    try
    {
        MyFile.PostedFile.SaveAs(@"C:\Downloads");
       ProgressTextBox.Text = "uploaded ok.... i think";
    }
    catch (Exception ex)
    {
        ProgressTextBox.Text = ex.Message.ToString();
    }

}




The code looks fine but the problem i have is that i keep getting an exception saying that the access to the destination folder is denied.

Access to the path 'C:\Downloads' is denied.

Ive been reading about granting permissions for 2 days now, and although im new to IIS i believe that because i have the NETWORK SERVICE but not ASPNET user available im using IIS 6.
in a disparate attempt to try and solve this i created a new project using the same C# code as above and pointed the images to be saved in a new directory "C:\Downloads". i granted full access permissions to all the users that were listed when i right clicked on the C:\Downloads dir and selected....

Sharing and Security
Security tab
add
Advanced
Find Now


The users that people have said should work "IUSR_mycomputer" and "NETWORK SERVICE" make no difference either, but even by giving all users, well over 60 of them full access permissions it makes no difference. Confused | :confused:

could it be something to do with the way ASP.NET, or IIS is installed on my machine ??


Im using Windows XP pro 64bit and Visual studio 2008.

basically my question is.... how can i grant write permissions to a folder in my asp.net app as changing permissions in the Sharing and Security properties has done nothing ?? Sigh | :sigh:

thank you for your time.... please help Cry | :((

Truegilly
AnswerRe: Access denied to folder in ASP.NET project either though I have granted all users full permissions !! Pin
truegilly30-Jun-08 3:14
truegilly30-Jun-08 3:14 
Questionuser control Problem Pin
Ajeet mittal30-Jun-08 2:29
Ajeet mittal30-Jun-08 2:29 
AnswerRe: user control Problem Pin
eyeseetee30-Jun-08 2:45
eyeseetee30-Jun-08 2:45 
GeneralRe: user control Problem Pin
Ajeet mittal30-Jun-08 2:48
Ajeet mittal30-Jun-08 2:48 
GeneralRe: user control Problem Pin
eyeseetee30-Jun-08 3:03
eyeseetee30-Jun-08 3:03 
GeneralRe: user control Problem Pin
Gayani Devapriya30-Jun-08 6:01
Gayani Devapriya30-Jun-08 6:01 
GeneralRe: user control Problem Pin
Ajeet mittal1-Jul-08 1:51
Ajeet mittal1-Jul-08 1:51 
QuestionValidator.RenderControl(htmlTextWriter) returns empty string? Pin
livez30-Jun-08 2:02
livez30-Jun-08 2:02 
AnswerRe: Validator.RenderControl(htmlTextWriter) returns empty string? Pin
ToddHileHoffer30-Jun-08 2:41
ToddHileHoffer30-Jun-08 2:41 
GeneralRe: Validator.RenderControl(htmlTextWriter) returns empty string? Pin
livez30-Jun-08 3:05
livez30-Jun-08 3:05 
QuestionHow to dispaly an image Pin
phetolel30-Jun-08 1:48
phetolel30-Jun-08 1:48 
AnswerRe: How to dispaly an image Pin
eyeseetee30-Jun-08 2:18
eyeseetee30-Jun-08 2:18 
GeneralRe: How to dispaly an image Pin
phetolel30-Jun-08 2:21
phetolel30-Jun-08 2:21 
GeneralRe: How to dispaly an image Pin
eyeseetee30-Jun-08 2:43
eyeseetee30-Jun-08 2:43 
GeneralRe: How to dispaly an image Pin
phetolel30-Jun-08 2:48
phetolel30-Jun-08 2:48 
GeneralRe: How to dispaly an image Pin
eyeseetee30-Jun-08 3:06
eyeseetee30-Jun-08 3:06 
Questionclass problem Pin
Miss Maheshwari30-Jun-08 1:45
Miss Maheshwari30-Jun-08 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.