You are here: Re: how to write html tag to download a file intead of show content of file in browser « HTML « IT news, forums, messages
Re: how to write html tag to download a file intead of show content of file in browser

Posted by David Dorward on 01/09/60 11:39

yihucd@gmail.com wrote:

> <%
> response.setContentType("application/vnd.ms-excel");
> response.setHeader("Content-Disposition","attachment; filename=" +
> "xls_to_del.xls" );
> %>
> <p>click <a href="xls_to_del.xls">file</a></p>

You need to send the Content-type that says "This is an Excel file!" when
you send the Excel file, not when you send an HTML document with a link to
the Excel file in it.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация