473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Response.AddHeader problem when using Javascript as the server-side scripting language

With reference to the ASPFAQ 2161 article -
http://classicasp.aspfaq.com/general...mime-type.html

Does the 'Content-Disposition' code work if the user is using
JAVASCRIPT as the SERVER SIDE scripting language, i.e.:

<%@LANGUAGE=JAVASCRIPT%>

If I add this header to a page that uses Javascript as the server-side
scripting language:

Response.ContentType = "application/save"
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

Then the page crashes with:

Microsoft JScript compilation (0x800A03EC)
Expected ';'
/myform.asp, line 8, column 19
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

Line 8, column 19 is:
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

It looks like IIS doesn't like something in the "Content-Disposition:
attachment; filename=MySpreadsheet.xls;" part of line 8 - probably a
Javascript syntax thing.

How can I fix it?

Feb 16 '07 #1
1 12602

"Andyza" <an****@webmail.co.zawrote in message
news:11**********************@t69g2000cwt.googlegr oups.com...
With reference to the ASPFAQ 2161 article -
http://classicasp.aspfaq.com/general...mime-type.html
>
Does the 'Content-Disposition' code work if the user is using
JAVASCRIPT as the SERVER SIDE scripting language, i.e.:

<%@LANGUAGE=JAVASCRIPT%>

If I add this header to a page that uses Javascript as the server-side
scripting language:

Response.ContentType = "application/save"
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

Then the page crashes with:

Microsoft JScript compilation (0x800A03EC)
Expected ';'
/myform.asp, line 8, column 19
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

Line 8, column 19 is:
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

It looks like IIS doesn't like something in the "Content-Disposition:
attachment; filename=MySpreadsheet.xls;" part of line 8 - probably a
Javascript syntax thing.

How can I fix it?
All procedures are functions in JScript all calls must use ( )

Try:-

Response.AddHeader("Content-Disposition: attachment;
filename=MySpreadsheet.xls;")

Feb 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam B | last post by:
Hello. I'm writing an aspx page that reads a file from disk and writes the file out through the Response.WriteBinary() method. This allows me to support security and custom reports for various...
0
by: Adam B | last post by:
Hello. I'm writing an aspx page that reads a file from disk and writes the file out through the Response.WriteBinary() method. This allows me to support security and custom reports for various...
2
by: Joseph | last post by:
Hello. I have this problem. See I have a transformed XML file and I checked its contents prior to outputting it to excel file via responseset. here is the gist of the code: XmlReader reader =...
1
by: abcd | last post by:
I am writing a page which uses response.binarywrite to the client, after it has completed sending the file I am interested in I want to display some mesange like "download completed" etc...I am...
3
by: Lars Netzel | last post by:
I want to press a Linkbutton (in a DatagridItem) and return a file that is not shared in the IIS. I want to disallow "deeplinking". The following code works fine (it sends the file I want) but I...
8
by: Katie | last post by:
Hi, I am trying to set the content type and header for the response object but for some reason it doesnt set it. I tried it on dev and it worked fine but didnot on production. The difference is...
3
by: guillermojco | last post by:
Hi, I've got an ASP.NET page that returns XLS, DOC, PDF and other files from binary fields in a database. The problem is that MS-Excel 2007 shows a security warning when trying to open the...
2
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. ...
5
by: Khafancoder | last post by:
Hi guys, i am building a FileSharing website, i wanna allow users to be able using download managers such as DAP to download files from webserver but don't allow them to retrive files url......
8
by: Tony | last post by:
I've searched the web & can't find an answer to this. Is it possible to successfully use Response.AddHeader for a robots meta tag? For example, I want to do <% IF request("PageID") = 252...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.