Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 1
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2008, 11:00 PM
Ranimi23 r Ranimi23 r is offline
Junior Member
 
Join Date: May 2008
Posts: 2
Default

How to save pdf file with ASP using JavaScript?


What I am trying to do is this: I have a PDF file and I instead the file will open in browser, I want a "saveas" dialog box to open and ask the user if he want to save the file.

I wrote this code in Java Script:

************************************************** ****

Response.Write("C:\ranimi.pdf");

Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=ranimi23.pdf");

************************************************** ****

But, something is wrong. I do get a "SaveAs" dialogbog and it did save something, but I can't open my "ranimi23.pdf" file at all and the size is telling me the file is not being saved as I think it will.

What should I do in "Response.Write" in order to get the file in response...

Please advise.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i save an image using c# .net? just a save button with a save... janejane .Net (ASP.Net, VB.Net, C#) 1 05-12-2008 09:24 AM
On Javascript, how to use a file select dialog box? roberto JavaScript 0 05-10-2008 04:06 PM
Is it possible to save information to an xml file on a website using philip32189 XML & XUL 0 05-08-2008 08:02 AM
php file save? patatasmonster PHP 0 05-07-2008 12:15 AM
How can i use JavaScript to read an XML file? Amanda XML & XUL 2 05-06-2008 01:15 PM

Your Ad Here

All times are GMT. The time now is 10:34 PM.