The default name of the document in the Save dialog box in the browser

I have JSP page which retrieves a document from a database and either displays it in the browser window(if it can be displayed as for pdf or word documents) or offers the user to save it on disk. Everything works fine except for in the latter case in the save document dialog browser offers the user to store the document with jsp page name and extention by default. I store the file name in another field in the database and want to use this name by default. Is there any way to control the name of the document which browser offers by default ?

Yes, there is a HTTP Header called Content-Disposition you can set the filename with that, here is some code from a JSP I use to download software from a database to the browser.
response.setContentType(doc.MimeType);
response.setContentLength(doc.BinaryData.length());
response.setHeader("Content-Disposition", "filename="+doc.Filename);
ServletOutputStream stream = response.getOutputStream();
byte[] data = doc.BinaryData.getBytes();
for(int i =0;i!=doc.BinaryData.length();i++) {
stream.write(data);
Now this all works in every browser except in Microsoft's Internet Explorer browser (ofcourse!) the "Save as" filename then is taken from the last part of the URL that looks like a file name!!! So my URL to the page that has the above code would look like /downloadSoftware.jsp?id=1234&file=somefile.ext and I don't do anything with the file parameter, it's just here for IE. This means all browsers that adhere to the HTTP standard will work and then Internet Exploder will also work...
Hope that helps

Similar Messages

  • Open/Save Dialoge Box covers the whole screen - CS3/Vista

    Hi,
    I´m using Photoshop CS3 on Windows Vista and I have the following problem:
    I can´t reduce the open/save dialoge box in Photoshop CS3 as I could in earlier versions, which I find very inconvenient.
    It stretches over the whole screen and there seems to be no way of reducing it. There are handles at the corners but they don´t work.
    Is this normal in CS3 or could it be just a wrong setting in Windows?
    I hope somebody can help me on this, thank you so much!
    Best regards,
    Mike

    Is this normal in CS3 or could it be just a wrong setting in Windows?
    No, it's not normal. There are two things I can think of:
    - the dialog repositioning feature of your graphics card is not working properly (NVidia Desktop etc.)
    - you resized the dialog in another program and now the huge size has become the system default
    In both cases the solution should be pretty obvious - either adjust the settings/ turn off the graphics card's special features or resize the dialog back in the program it was turned huge in the fi8rst place. For the latter, also checking your more general folder view options as well as manually deleting desktop.ini files may offer a way out.
    Mylenium

  • Turn off save dialog box when the close command is executed

    I would like to set the default value of the save dialog box to No when my users close my form, so they do not have to manual answer this question.  Is it possible to do this or is there a commmand I can place in docClose to tell the form to close without saving?
    Thanks
    -Anne

    The Downloads folder defined in Mail/Prefs/General is just to temporarily store decoded attachments.
    The Save dialog is available by pressing *and holding* the Save lozenge button next to the attachment(s) in the message header header, or right-clicking/save attachment on files visible in the message body.
    (Having to click and hold the save button to get something useful is extremely bizarre, and IMO broken)
    You can also drag and drop items from the message to a Finder window or whatever.

  • MS Word: This file is read-only. To save a copy, click OK, and give the document a new name in the save dialog box.

    This is not a question. I believe I've found a new issue and the fix for it.
    The situation:
    A brand new iMac 27" running Yosemite 10.10.1
    MacMini server running 10.8.5 server.
    The issue:
    Client on iMac trying to work on MS Word documents stored on server was requiring him to save the documents to his desktop and then copy them back to the folder on the server. The exact error message was, "This file is read-only. To save a copy, click OK, and give the document a new name in the save dialog box."
    The issue is unique to this computer in an office of 10 client computers and three servers.
    Attempted fixes:
    Verified that the ".Temporaryitems" folder existed and the permissions were set properly.
    Repaired permissions on the client and the network share.
    Definitive fix:
    By default, Yosemite 10.10.1 uses SMB for connecting file shares. When I overrode the default and switched to AFP protocol, the issue went away.
    I hope this helps someone else.
    Rob

    That was it. What an operating system. It is very helpful to view files you are looking for. But if you have preview on you cannot save files.

  • How to obtain the default serie for a document

    Hi,
        Anybody know how can obtain the default serie for a document throw a query??
    I can`t see the relation between the ONNM and the NNM1 tables because the 'dfltseries' field of the ONNM not corresponding with the 'Series' field of the NNM1.
    For example for an A/P Invoice
    Thanks!!

    Hi Mariano,
    According to the SDK Help file, you need to query the NNM2 table
    Series Default
    Table name: NNM2
    ObjectCode     UserSign     Series     DocSubType
    So, the query to retrieve the A/P default series for the manager user would be:
    SELECT T0.Series FROM [dbo].[nnm2] T0 WHERE T0.ObjectCode='13' AND T0.UserSign = 1
    From the SDK you can replace the T0.UserSign = 1 for T0.UserSign = oCompany.UserSignature to retrieve the default series for the current user...
    Regards,
    Vítor Vieira

  • How do I change the default settings for opening documents on my macbook?

    Hi I would like to know how to change the default settings for opening documents on my macbook. Everytime I try to open a doc. it automatically opens with Textedit, instead of Pages or another program.

    Select any particular document you wish to fix. Press COMMAND-I to open the Get Info window. In the Open With section select the desired Default Application from the dropdown menu. Click on the Change All button to extend the change to all similar documents.
    You can only assign one default application to one type of document.

  • How to change the default name of new adjustment layers? (and other Q's)

    How do I change the default name of new adjustment layers?
    How can I make it so that adjustment layers don't come with a mask when I create them (unless I have a selection active)?
    Why isn't the Shadows/Highlights functionality an adjustment layer? It's accessable under "adjustments" but you can't use it non-destructive
    Where can I find documentation on Photoshop's API? (I want o make tools for it - javascript)

    Forgive me for not looking into your Maya-specific links, but one can automate Photoshop using JavaScript indeed (on Windows also VB, on Mac also AppleScript).
    Not everything can be automated naturally, but a lot – and it can really speed up many tasks; and with the »small« repetitive ones like saving copies off of files etc. combining Scripts with Configurator Panels can be especially convenient.
    There is a Scripting Forum over at
    http://forums.adobe.com/community/photoshop/photoshop_scripting
    As for plugins: it's something I would like to learn some day (I guess you would have to go with Flash and AS3 for making actual plugins)
    I think you might also have to learn C++ or C.
    There is Forum the contributors to which might be able to give you pointers if you get to that. 
    http://forums.adobe.com/community/photoshop/photoshop_sdk

  • How do you change the default setting for RTF documents from TextEdit to MS Word

    How do you change the default setting for RTF documents from TextEdit to MS Word, I download forms from the Canadian government and they use RTF as a standard, they are supposed to open as MS Word documents (Yes I have Office for MAC 2011) but when download the document it goes to TextEdit which messes up the form format. I can down load it right click and go "open with" MS Word but how can I get the default chnaged to save this step.

    richr604 wrote:
    Thanks I knew this, I like Safari as I want to keep everything MAC, but if I use Firefox the documents open in MS Word straight away, I was just curious if there was some setting I could change?
    In Firefox > Preferences, click the Applications tab. If RTF is there, use the pulldown menu in the Action column to pick MS Word. If RTF is not there, there are instructions here for how to add file types.

  • Changing the Default name of DVD Disk in OneStep

    Is it possible to change the default name of the disk that is burned on iDVD 6 "OneStep DVD" ???
    the default disk name becomes "IDVDONESTEPDVD"...
    I make lots of DVD with OneStep and would like the name created to be different.
    Is this possible and if so...How??
    Thanks for your advice...
    STDigital

    Not sure if this is possible or not but did you already check the iDVD6 Help Menu and try the following?
    Choose Project > Project Info. Type the new name in the Disc Name box.
    If this approach isn't possible, then it's likely not a very good idea to change its default title. Good luck.
    (3) G4 PM's/(3) S-Drives/Sony TRV900/Nikons/6FWHD's/PS7/iLife06/FCPHD/DVDSP/etc. Mac OS X (10.4.8) My ichatav AIM account is: SDMacuser1 (Please use Text chat prior to video)

  • Wiring the default name on File Dialog causes an error 43

    LabView 8.5 Pro:
    I placed an express file dialog on my diagram. I wired the start path and ran my vi. As expected the open file dialog box appears, however if I wire the default name to the vi the dialog box does not display and generates an error 43. The default file name I am wiring is CT_TE5000001.xlsm. This was working fine on my previous LabView 6.1. I didn't see any entries on the known bug list. Any ideas would be appreciated.

    Thank you for the reply.
    I found my problem.
    There was a \r\n appended to part of my default file name which caused it to cancel the file dialog.
    The filename was CT_TE5000001\r\n.xlsm instead of the desired CT_TE5000001.xlsm.

  • TS2755 When I iMessage, I type in my friends name, then select her cell number that is in my contacts.  When I start the iMessage, her husband's name shows up as the default name for who I am messaging.  How do I change it so that her name shows up?

    When I iMessage, I type in my friend's name, then select her cell number from my contacts.  When I start the iMessage, her husband's name automatically fills in as the default name.  My friend is getting the iMessage, but this is confusing to me, the sender.  I want her name to automatically be the default when I select her cell number.  How do I change this? Using the 3rd generation iPad with retina display.

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • When drag and dropping a page to a separate folder the default name is "Untitled Extract Pages.pdf", how do I change this to other default name?

    Hi,
    When drag and dropping a page to a separate folder the default name is "Untitled Extract Pages.pdf", how do I change this to other default name?
    Thanks for any reply that can help!
    BR
    /H

    I don't think you can change it.

  • How to set the default name when exporting a report ?

    <p><span class="PSLONGEDITBOX">I use crystal reports in my C# asp application, with the CrystalReportViewer class. When the end user exports the reports by clicking on the toolbar button, the "save as" dialog box appears, with  default name "_viewer.pdf" or "_viewer.xls" etc. "_viewer" being the CrystalReportViewer&#39;s instance name. <br />Has anyone an idea to change this default name ? </span></p><p><span class="PSLONGEDITBOX">T</span><span class="PSLONGEDITBOX">he end user would like at least the report name. <br /><br />Thanks</span></p>

    I looked around and I it appears that you have found the only way to set this. There doesn't seem to be dynamic support for the exported file names.
    Rob Horne
    http://diamond.businessobjects.com/blog/10

  • What is the default name of the folder where the cache (i.e. Firefox's temporary internet files) is stored?

    What is the default name of the folder where the cache (i.e. Firefox's temporary internet files) is stored? Basically, what folder is Firefox's equivalent of Temporary Internet Files?

    You can find the location of the cache on the about:cache page (open that page via the location bar like a website).
    Only large image and media files are stored as individual files on disk.<br />
    Other files are stored in a few large container files (_CACHE_XXX_) in the cache folder and not as separate files on disk.<br />
    The individual files on disk have random names without a file extension for security reasons: you can't open an application or start a downloaded virus inadvertently by clicking a file in the cache folder.<br />
    You can look at this extension for easier access to files in the cache.
    * Cache Viewer: https://addons.mozilla.org/firefox/addon/2489

  • Is there no way to update the "Default Lables" on all slides once I've changed it under the Preferences?

    Is there no way to update the "Default Lables" on all slides once I've changed it under the Preferences?
    I really don't want to recreate the slides from scratch again.

    What about File, Export, Text Captions...? You'll have a Word document with two columns. Translate the second column (much easier in Word) and import again. That is the normal work flow for translation. Same is possible with XML instead of Word.

Maybe you are looking for