Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi sir,
my name is deva a dotnet developer can any one please help me in writing a code to preview any document of any extension in webpage if u have any code already please post me and help me


thanks in advance


regards,
dev
Posted
Comments
CodingLover 19-Oct-11 0:49am    
Preview sense, you want to show a preview of word document, html, etc?
Sergey Alexandrovich Kryukov 19-Oct-11 2:09am    
Well, OP told you: any, it could be understood in only one way... :-) Please see my solution... :-)
--SA
krishna_goluguri 19-Oct-11 1:05am    
you have to say for which extension you want the preview because all the extensions at a time is not possible
Sergey Alexandrovich Kryukov 19-Oct-11 2:07am    
Impossible? Good point, but... there is a variant, please see my solution... :-)
--SA
Mycroft Holmes 19-Oct-11 3:07am    
Yeah but SA your solution is typical MS, technically correct but absolutely useless (I need a smiley here).

1 solution

If you are not joking about any extension… (extension itself means nothing, moreover, there are no real "extensions" in modern file systems including NTFS, but that should mean that the file format could be anything at all); so, if you really mean any extension, the only possible way would be treating a file as binary regardless if it structure and presenting is in some human readable way, for examples, bytes could be presented as pairs of hexadecimal digits, base64 will also do, as a bit more cryptic variant.

Yes, I understand it's quite useless, but you know, the answer is defined by the question, no more, no less. :-)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900