Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set Http Header in a pop windows?

Status
Not open for further replies.

tonygale

Programmer
Dec 6, 2005
1
US
I need to set the MIME type to application/vnd.ms-excel in a pop out window. How can I do this in Javascript? I tried document.open("application/vnd.ms-excel");
But, it doesn't work.

Can anybody help me?

Thanks
 
You can't set the headers client-side. You would have to do this server-side. Do you have something like php avaiable? If so, output the header from php then start streaming the content file (again, using php).

The only javascript part is the initial window.open() call that requests a php file that might take an excel file name as a passed parameter.

Best to post the request in the server-side forum that matches your environment (php, asp, jsp, cfm etc).

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top