I have a folder in the server and when I upload a file overwrite the existing file (means I save the file with the same name).
So when I open my website it should show me the new uploaded file but it shows the old file instead.
Is there any way to hard code directory refresh?
string folderPath = Server.MapPath("~/Resources/Slider/");
if (!Directory.Exists(folderPath))
{
Directory.CreateDirectory(folderPath);
}
//Save the File to the Directory (Folder).
String extension = Path.GetExtension(FileUpload1.FileName);
FileUpload1.SaveAs(folderPath + "slide" + s4 + extension);
s4 = 1 or 2 or 3
This is how the directory that I want to refresh slider folder: