473,246 Members | 1,934 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,246 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 12572

"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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...

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.