so i have this code:
try
{
if ((uplImage.FileName != ""))
{
//to allow only jpg gif and png files to be uploaded.
string extension = Path.GetExtension(uplImage.PostedFile.FileName);
if (((extension == ".jpg") || ((extension == ".gif") || (extension == ".png"))))
{
DALBio bio = new DALBio();
byte[] raw;
FileStream fs = new FileStream(uplImage.PostedFile.FileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);
raw = new byte[fs.Length];
fs.Read(raw, 0, Convert.ToInt32(fs.Length));
bio.PlayerID = Session["playerID"].ToString();
bio.Pending = 'Y';
bio.Photo = raw;
DALBio.insertImage(bio);
}
}
}
catch (Exception e1)
{
Label1.Text = e1.InnerException.ToString();
}
and the program breaks on the FileStream fs = new FileStream line. at first my image was in my downloads folder and it said access to c:\prog(x86)\filefolder\file\folder\and so on was denied
so i moved it to my images folder, and i got the same error to a different folder on c. my google searches have said it oculd be a permissions thing (if its UAC, that makes no sense, i have all permissions possible across the board). another thing is it could be a change in my web.config file about application settings, however without any examples or better insight than what i did get from those searches, i am lost.