|
-
Jun 16th, 2005, 04:39 AM
#1
Thread Starter
Member
Show "Save As" dialog
Hello everyone,
i have a problem with my web (jsp) page..
i need to show the "save as" dialog and save a file(a pdf file to be specific)..
i was able to show the dialog already but the problem is it will save the web page...
Code:
document.execCommand('SaveAs',null,fname)
is there any way I could specify the file using the above command?
or is there a better way of doing this?
please help me..any suggestions will be greatly appreciated...
PS i am really sory if im in the wrong forum..but im hoping somebody could help me out here...
many thanks in advance.
-
Jun 16th, 2005, 06:05 AM
#2
Re: Show "Save As" dialog
This question is for html/javascript... my friend got lost, sorry about that. Can anyone please show her the way, by moving her question to the right forum?
-
Jun 16th, 2005, 04:39 PM
#3
-
Jun 16th, 2005, 11:50 PM
#4
Re: Show "Save As" dialog
Thanks greatly appreciated.
-
Jun 17th, 2005, 04:11 AM
#5
Thread Starter
Member
Re: Show "Save As" dialog
thanks belle..
and thanks to u manavo11..
any ideas?
ive been told that Content-Disposition = attachment could be the solution to my prob..still searching for valuable infos bout this one...but any inputs will be greatly greatly appreciated..
many thanks...
-
Jun 17th, 2005, 05:56 AM
#6
Re: Show "Save As" dialog
Do you have access to the server?
By adding a file type of a pdf and saying it' content type is of application/octet-stream,you can force the Save As dialog to appear when the user clicks on a link to a pdf.
-
Jun 17th, 2005, 07:17 AM
#7
Fanatic Member
Re: Show "Save As" dialog
deadeyes, could you give more detailed instructions because im having the same problem but dont really knwo much about servers.
-
Jun 17th, 2005, 08:49 AM
#8
Re: Show "Save As" dialog
Hi DaveBat
In IIS
Right click your websites
select properties form the context menu
From the dialog box select the HTTP Headers Tab
Down the bottom you'll see MIME Map
Press the File Types button
Press New Type button
Enter the extension "pdf"
Enter the content type "application/octect-stream"
ok
ok
apply
ok
Now from you website when you click a link to a pdf instead of it being displayed in the browser window the save as dialog appears.
HTH
-
Jun 20th, 2005, 02:52 AM
#9
Fanatic Member
Re: Show "Save As" dialog
-
Jun 20th, 2005, 07:59 AM
#10
Thread Starter
Member
Re: Show "Save As" dialog
 Originally Posted by DeadEyes
Do you have access to the server?
By adding a file type of a pdf and saying it' content type is of application/octet-stream,you can force the Save As dialog to appear when the user clicks on a link to a pdf.
hello deadeyes, thanks for the reply.
i actually ddnt need to change the IIS settings.
got it working by using the following (jst in case somebody's interested)
Code:
response.setHeader ("Content-Disposition", "attachment;filename=\"" + request.getParameter("file") + "\"");
but really i do appreciate your time. many thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|