May 3rd, 2017

Why don’t I get thumbnails for files that are marked offline?

A customer deployed a data archival system that migrates files to network-attached storage after a period of inactivity. The customer reported that when a file is archived, they are no longer able to see thumbnails in Explorer. The customer contacted the vendor of the archival system, and the vendor explained that the archival system’s default configuration sets the FILE_ATTRIBUTE_OFFLINE attribute when a file is archived. And Explorer doesn’t show thumbnails for offline files.

The customer wanted to know whether this was by design.

Yes, this is by design. Explorer assumes that files that are marked offline must not be accessed casually, because any attempt to access an offline file will cause it to be recalled from archival storage and brought online. And you can’t generate a thumbnail for a file without accessing the file.

If Explorer were to read a file in order to generate a thumbnail, that would mean that opening a folder would recall every file!

The customer is faced with a choice,

If you set the offline attribute when a file is archived, then Explorer will not recall the file until you take an explicit action on the file, like double-clicking it. This means that Explorer will not read the file in order to generate a thumbnail or a customized icon or a preview, nor will it read the file in order to extract other properties. (And it expects all shell extensions to respect the offline attribute and follow the same policy.) This is good for your archival system because it means that archived files stay archived until somebody actually wants it, but it means that you lose out on some features because those features would trigger a recall.

On the other hand, if you do not set the offline attribute when a file is archived, then Explorer will access the file in order to generate thumbnails and customized icons and previews, and it will read the file in order to extract other properties. This gives you all the features of normal files, but it has a good chance of negating the work your archival system performed because it will trigger a file recall.

On the other hand, if the archival storage system offers fast retrieval of file contents (possibly with a policy of not actually recalling the file until some other signals are received), then maybe omitting the offline attribute is the right thing.

You’ll want to try it both ways and see which you like better. But at least you now understand the tradeoffs.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.