I have a page where users can add attachments to an email. The code to save the files to the server is below. When I start uploading I will write to the page (for example) 'Uploading File 1 of 4'. When the first file has been saved, I want to refresh the text the user is viewing to say ... 'File 1 uploaded, Uploading File 2 of 4' etc. I don't need to show a progress bar or anything fancy ... but how can you keep the browser updated so the user can see how many files have been uploaded etc.
Code:HttpFileCollection hfc = Request.Files; for (int i = 0; i < hfc.Count; i++) { HttpPostedFile hpf = hfc[i]; if (hpf.ContentLength > 0) { hpf.SaveAs(path + ReturnValue.ToString() + "\\" + Path.GetFileName(hpf.FileName)); //****************** This is where I need to update some text in the browser as each file is uploaded *********************** } }




Reply With Quote