1

I am developing an ASP.NET 3.5 web application and I have a folder in the project which contains a list of documents which could be pdf or any of the MS office 2003 or 2007 supported file formats. I would like to display these files to my users as thumbnails (just like the way windows displays files). And when the user clicks on a file it has to prompt them to either save the file or open in the browser itself. How can I achieve this?

Kumar
  • 2,863
  • 11
  • 45
  • 60
  • I don't it's reasonable to ask the community to write a solution for you. However, this could easily be achieved with a little C# code. As a starting point look at `Directory.GetFiles(..)` to get a list of the files and `Image.GetThumbnailImage(..)` to get a thumbnail of the image. From there, there are many ways you could display it. – codemonkeh Mar 28 '10 at 22:50

2 Answers2

1

You can get the files like this (assuming /Documents)

string path = Server.MapPath(@"/Documents");
string[] files = System.IO.Directory.GetFiles(path);

And nou you only have to write some HTML generating code to display the files the way you want them displayed.

H H
  • 263,252
  • 30
  • 330
  • 514
1

the answer at the following question seems to be RIGHT up your alley (ie the answer)

C# get thumbnail from file via windows api

Community
  • 1
  • 1
Doug
  • 6,460
  • 5
  • 59
  • 83