Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I know in Sharepoint 2010 Foundation there is no Thumbnail feature but let me explain my problem 'cause I need just the thumbnail creation invoked programmatically, not to show the image or something like that so if the functionality is exposed by Object Model I can solve my problem.

I have a Web Service that expose some methods. One of the method I must implement had to get the "ID" of the file and return the thumbnail of the selected file.

To me the best could be:

  • On file Adding: SPListItem.CREATETHUMBNAIL
  • On my Web Service Invocation: return SPListItem.THUMBNAIL

Is there, in Sharepoint 2010 Foundation the possibility to return the Thumbnail of a file? There are other ways to implement it?

Thank you very much!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can get a thumbnail image from SharePoint 2010 OOTB just using some URL manipulation on the image URL in the library. For example if you have an image at the URL:

http://server/site/library/image.jpg

You can get a thumbnail for this with the URL:

http://server/site/library/_t/image_jpg.jpg

To generate a thumbnail you must insert _t as an additional directory in the URL and append _[extension] to the filename before the extension.

share|improve this answer
1  
You also the _w prefix for "web" scaled images (640px if I'm right) –  Steve B Jan 7 '13 at 13:28
    
That's right Steve, if the image is larger than 640px wide, otherwise _W will just return the image. The thumbnails generated with _t are 160px wide. –  robwilliams Jan 7 '13 at 13:32
    
Works also for PPT, PDF and so on or only for images? Thank you! –  Ziba Leah Jan 7 '13 at 14:32
1  
One would assume this only works for images. If you are looking for an icon for PDF, PPT etc then use an image. If you are looking for a thumbnail preview of the contents of a PDF, PPT etc whilst definitely acheivable programmatically it would be a considerable undertaking. –  robwilliams Jan 7 '13 at 14:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.