I use File Uploader control. I want the user to:
1) Search any location
2) Choose and load any .JPG file or any other image format file
3) Store that particular file in the DB (SQL).
Solution: I achieved all these, however I hardcoded the path.
Problem: I don't know how to remove this hard coding and achieve above 3 points :( Please help tweak the code:
if (FileUpload1.HasFile)
{
FileStream FS = new FileStream(@"C:\Users\Ramakrishnan\Desktop\New folder\001.jpg", FileMode.Open, FileAccess.Read);
byte[] img = new byte[FS.Length];
FS.Read(img, 0, Convert.ToInt32(FS.Length));
}