Results 1 to 10 of 10

Thread: Show "Save As" dialog

  1. #1

    Thread Starter
    Member n0vembr's Avatar
    Join Date
    Jun 2005
    Location
    pilipinas kong minumutya
    Posts
    60

    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.

  2. #2
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    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?

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Show "Save As" dialog

    OK, moved


    Has someone helped you? Then you can Rate their helpful post.

  4. #4
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Show "Save As" dialog

    Thanks greatly appreciated.

  5. #5

    Thread Starter
    Member n0vembr's Avatar
    Join Date
    Jun 2005
    Location
    pilipinas kong minumutya
    Posts
    60

    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...

  6. #6
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    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.

  7. #7
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    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.

  8. #8
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    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

  9. #9
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    Re: Show "Save As" dialog

    Cheers, that worked.

  10. #10

    Thread Starter
    Member n0vembr's Avatar
    Join Date
    Jun 2005
    Location
    pilipinas kong minumutya
    Posts
    60

    Red face Re: Show "Save As" dialog

    Quote 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
  •  



Click Here to Expand Forum to Full Width