Hi all, I'm using a FileStream to download information of an FTP server to a directory on my C:\ drive. For some reason, even though I've even tried setting the directory permissions to even 'Everyone' access, it's given me this exception:
System.UnauthorizedAccessException: Access to the path 'C:\tmpfolder' is denied'
Why is this? Here is an extract of my code.
byte[] fileData = request.DownloadData(dataMap.GetString("ftpPath") + "/" + content);
file = new FileStream(@"C:\tmpfolder", FileMode.Create, FileAccess.Write);
downloadedlocation = file.ToString();
file.Write(fileData, 0, fileData.Length);
Also, my program is not in ASP.NET and is just a C# console app.