0

Hi,

I'm trying to download a file from the web onto my desktop via my form. However, I keep getting a 'Access to the path is denied' error whenever I start the download. I'm using Win7 if that changes anything... Here's where the error occurs:

//create a new file stream where we'll be saving the data
                    strLocal = new FileStream(txtPath.Text, FileMode.Create, FileAccess.Write, FileShare.None);

strLocal is a Stream with the stored data of the file I'm downloading.

Edited by papanyquiL: n/a

4
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by penglund
0

What does txtPath.Text evaluate to at run time? If you're running as a non-admin and attempt to save to another user's profile path, for example, it will give you that error.

0

I have a similar error when trying to create a file. My program creates a folder if it doesn't exist but cannot create a file in that folder. There is another component trying to create the file and it gives me this exception.

What can be done??

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.