In my web apllication ,I am saving the Photo into the DataBase.
For doing this i am reading the content of picture in byte[] as:
Expand|Select|Wrap|Line Numbers
- byte[] img = new byte[fuPhoto.PostedFile.ContentLength];
- FileStream fs = new FileStream(fuPhoto.PostedFile.FileName, FileMode.Open);
- BinaryReader br = new BinaryReader(fs);
- br.Read(img, 0, fuPhoto.PostedFile.ContentLength);
In the second line of code..Its throwing exception:
Could not find file 'c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\sumit sachdeva.jpg'.
Please help.
Regards,
Gyanendar