0

Hi,

I have a application where we upload pdf files.And also i have button in another page to download it.As and wen a new file is uploaded that file should be downloaded on clicking the download button.

The follwing code fetches all the pdf files
filelist contains all pdf files..
Further how to download latest uploaded file.
Can anyone help me out PLZ.

DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath(@"\sssssss\"));
        ArrayList fileList = new ArrayList();
        string[] fExtensions = { "*.pdf"};
        foreach (string ext in fExtensions)
        {
            fileList.AddRange(dirInfo.GetFiles(ext, SearchOption.AllDirectories));
        }

        ArrayList tempList = new ArrayList();
        tempList = fileList;
      

        for (int i = 0; i < fileList.Count; i++)
        {
            for (int j = i + 1; j < fileList.Count; j++)
            {
                if (fileList[j].ToString() == fileList[i].ToString())
                {
                    tempList.RemoveAt(j);
                }
            }
        }
        fileList = tempList;
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by vsa000
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.