Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 2nd, 2007, 12:18 AM
Authorized User
Join Date: Jan 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default How HTML understands the file format(according to

How HTML understands the file extension?
When i open a zip file or any other file extension
it should understand the file extension and render it accordingly.
Can anybody have any idea how can we do this using VB.NET or HTML?

Old February 2nd, 2007, 02:01 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons


================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Old February 5th, 2007, 12:43 AM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

When the browser follows a link to a file with a certain extension, the browser decides how to deal with it. Often, such as when the browser doesn't know directly how to deal with a certain extension, it delegates the handling to the operating system. This is where a compression tool (WinZip for example) would pick up the handling of the item requested.

When you send data out from a web server, you can attach header information to the HTTP response that contains information to identify the type of information you are feeding the browser. So if we had an ASP.NET web form that actually emitted data that we wanted to see in Microsoft Excel, we could add a header to the HTTP response identifying the "ContentType" as "application/ms-excel". This would tell the browser how to handle the data, even though the URL may look like it's a regular web page. (In fact, pages with the aspx extension are sent to the browser with the content type of "text/html". Otherwise the browser wouldn't know to display it as HTML.)

In .Net code, you would do this something like this:

Response.ContentType = "application/ms-excel"

Google "http content type" for more details and various lists of content types.


Similar Threads
Thread Thread Starter Forum Replies Last Post
How HTML understands the file format(according to bhavna General .NET 0 February 2nd, 2007 12:17 AM
Download file in HTML format itHighway Classic ASP Professional 2 April 28th, 2006 12:52 AM
plain vs HTML format juergreh Beginning PHP 2 April 19th, 2005 08:42 AM
Convert to HTML Format thomaz C# 0 October 28th, 2004 01:36 PM
email in html format alitoday HTML Code Clinic 3 June 19th, 2004 08:31 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.