i have a form where you enter information about the picture and upload it, the upload code in the html form is :
@FileUpload.GetHtml(
initialNumberOfFiles: 1,
allowMoreFilesToBeAdded: false,
includeFormTag: false,
uploadText: "Upload");
and in the c# code in the same page i got :
var fileName = "";
var fileSavePath = "";
var uploadedFile = Request.Files[0];
fileName = Path.GetFileName(uploadedFile.FileName);
fileSavePath = Server.MapPath("~/Images/inscriptions/" +
fileName);
uploadedFile.SaveAs(fileSavePath);
for some reason i get the error "index out of range" on the line :
var uploadedFile = Request.Files[0];
i want the user to click browse choose the file and fill the other Text boxes and click save to upload the picture and fill the info in the database(which is handled)