Hi Mohammadmk,
Check with the below code. As per your code it looks ok. Only you need to use postedFile.FileName instead of FileUpload1.FileName
string para = "@BinaId,@Binam,@arazi,@roidadMajlisFile,@roidadMajlisPath";
object[] values = new object[5];
if (FileUpload1.HasFile)
{
foreach (HttpPostedFile Postedfile in FileUpload1.PostedFiles)
{
string FilePath = Server.MapPath("~/RoidadMajlis/") + Guid.NewGuid() + Postedfile.FileName;
string f1 = FilePath.Substring(FilePath.LastIndexOf("\\"));
string[] split = f1.Split('\\');
string newpath = split[1];
string path = "~/RoidadMajlis/" + newpath;
values[0] = binaId;
values[1] = binaMember;
values[2] = AraziId;
using (Stream fs = Postedfile.InputStream)
{
using (BinaryReader reader = new BinaryReader(fs))
{
byte[] bytes = reader.ReadBytes((Int32)fs.Length);
values[3] = bytes;
}
}
values[4] = path;
}
Response.Redirect(Request.Url.AbsoluteUri);
}
If you are getting any error then please provide the error detail. Also check the browser console window for any error details.