Database: column name Photo datatype = varbinary
C# code
if(FileUpload1.HasFile)
{
byte[] picByte = FileUpload1.FileBytes;
string fileName = FileUpload1.FileName;
string FilePath = Server.MapPath("~/MustajirPhotos/") + Guid.NewGuid() + fileName;
string f1 = FilePath.Substring(FilePath.LastIndexOf("\\"));
string[] split = f1.Split('\\');
string newpath = split[1];
string picPath = "~/MustajirPhotos/" + newpath;
values[21] = picByte;
values[22] = picPath;
FileUpload1.SaveAs(Server.MapPath(newpath));
}
this code is not giving me any error but it is not saving as well
it just simply save in photo column 0x89 or 0xFF something like this
any solution please
thanks