Controling document's name Servlet

previous thread when thought a js issue: http://forums.sun.com/thread.jspa?threadID=5399163
httpServletResponse.reset();
httpServletResponse.setContentType(contentType);
httpServletResponse.setHeader("Content-Disposition", "filename=\"" +original_filename+ "\"" );
httpServletResponse.setContentLength(content.length);
ServletOutputStream stream = httpServletResponse.getOutputStream();
stream.write(content);
stream.flush();
stream.close();At this point when you click the word download link it opens the download popup with the correct filename printed. If save is clicked it will open the save as box with the correct filename. BUT if we hit open the word doc opens and its title is the servlet name: "PDFServlet(Read-Only)"
I am using IE 6

private void writeContent(HttpServletResponse httpServletResponse, byte[] content, String contentType) throws IOException {
  if (content != null) {
    //will run the inline code if it is a pdf
    if(contentType == "application/pdf"){
      httpServletResponse.reset();
      //httpServletResponse.setHeader("content-type", contentType);
      httpServletResponse.setContentType(contentType);
      httpServletResponse.setHeader("Content-Disposition", "inline;");
      httpServletResponse.setContentLength(content.length);
      ServletOutputStream stream = httpServletResponse.getOutputStream();
      stream.write(content);
      stream.flush();
      stream.close();
    //will run the attachment code if it’s a word file
    else{
      httpServletResponse.reset();
      String original_filename = "Insert form title here";
      //httpServletResponse.setHeader("content-type", contentType);
      httpServletResponse.setContentType(contentType);
      httpServletResponse.setHeader("Content-Disposition", "attachment;filename=\""+ original_filename+"\"");
      httpServletResponse.setContentLength(content.length);
      ServletOutputStream stream = httpServletResponse.getOutputStream();
      stream.write(content);
      stream.flush();
      stream.close();
}After looking at a few tutorials i updated using attachment and inline however I'm still having the same problem

Similar Messages

  • Pages "search document by name" isn't there!

    I just updated Pages, was looking forward to searching documents by name.
    But, after restarting my ipad, I don't see how.
    Any hints?

    And your Brother was added in Printer setup control panel? And your have ML; you have the current supported driver for Brother and it WORKS in other apps.
    Troubleshooting printer issues in Lion and ML
    http://support.apple.com/kb/TS3147
    OS X Mountain Lion and OS X Lion systems will have the necessary printing software already installed, or will automatically download and install software when the printer is connected or configured. Do not install software that came with the printer as it may be out of date, and do not connect the printer to your Mac yet. Follow the instructions that came with the printer to unpack, install ink or toner, and insert paper.  Finally, use the instructions in this article to connect the printer to your Mac.
    Make sure the printer model is listed in Printer and scanner software, which is a comprehensive list of all printer models that have compatible software for OS X Mountain Lion and OS X Lion.
    How to add a printer
    Start a print job on the Mac and manage its options
    Generate and manage PDFs
    Manage the printer queue and printer dock icon
    Share the printer queue
    Mac OS Printing/Fax (any version), OS X Lion, OS X Mountain Lion
    http://www.apple.com/support/osx/
    printing in OS X Mountain Lion
    http://support.apple.com/kb/HT4670

  • Controlling Document

    Dear gurus
        When I was doing billing document  system is generating  all documents like accounting  , profit center  and controlling document , here my accounting and profit center document is perfect  ,if I view the  controlling document  I cannot able to understand  , below details I found  there, even still now I didu2019t  use   COPA ,normally while doing the business transaction  if we give any cost object like cost center , internal order ,this object is our controlling document  this is my concept ,than  why system is generating this documents , what is the purpose
    Business Transaction u2013 COIN
    Document type u2013 RV
    Original bus. Trans - SD00
    CO object name - Profitability Analysis
    Object type - Reconciliation Obj.
    Object type u2013 REO
    Can anyone please give me your suggestions, If my concept is wrong please correct me
    Regards
    Sri

    Hi Divraj,
      Can you explain me some more concept
    Regards
    Sri

  • False message: The document name you requested (/selector_test.html) could not be found on this server. However, we found documents with names similar to the one you requested.

    When I specify http://www.celticmanner.com/selector_test.html to Firefox 6.01, I get the false message:
    Multiple Choices
    The document name you requested (/selector_test.html) could not be found on this server. However, we found documents with names similar to the one you requested.
    Available documents:
    /selector_test.txt (common basename)
    The file http://www.celticmanner.com/selector_test.html IS PRESENT on the host.
    The file http://www.celticmanner.com/selector_test.txt IS NOT. (It had been earlier.)
    I do not find the text "selector_test.txt" anywhere on my partition C! Where does Firefox retain a pointer to this file that no longer exists? And why?
    NB: The text "could not be found on this server" is sloppy. That message is not issued from a servcer, but from the instance of Firefox on my computer. The message should read "could not be found on the specified server".
    B. Somers

    I have the same problem and it does not have to do with firefox. Do you have any idea how to fix it through?

  • Controlling Document Not Getting Posted

    Dear All,
    We have a peculiar scenario of Controlling Document not getting posted. Any pointers on wat could be the issue will be highly helpful.
    Scenario:
    We have an interface which posts an accounting document.
    Dr. Expense
    Cr. Balance Sheet.
    The Cost Center is supplied thru the interface and FI document and Profit Center Document is posted without any issues. However, CO document is not generated, not sure wat could be the issue. We have performed the basic checks. Also, for the same expense account, we observe some postings have gone into CO where are some didnt'. The difference between documents posted with corresponding CO and documents without corrsponding CO posting is only the "Transaction Key". When we maintain blank Transaction key.. the system posts CO document, when transaction key is "WRX" for that specific GL the system doesn't post.
    Not sure why Standard SAP behaves like that. Please advice wat items i need to check to resolve
    this.
    regards
    Diwakar

    Hello,
    Make sure in OBYC, for key WRX, you have maintained the GL accounts.
    Regards,
    Ravi

  • Controlling Document not posted upon GRS of PO with account assignt type A

    My company is going to upgrade our SAP ERP system from version 4.6C to ECC5.
    In version 4.6C, when a Purchase Order (PO) is created and assigned to:
    (1) project wbs element
    (2) asset
    Upon GRS, the following accounting documents are normally posted:
    (1) Accounting document
    (2) Profit center doc.
    (3) Spec. purpose ledger
    (4) Asset transaction
    (5) Cost accounting doc.
    Following, if I want to view the Actual Cost line items posted for the project wbs element in mind, I am able to view the details via transaction CJ74.
    However, in ECC5, simulating the same scenario as described earlier, i.e. a Purchase Order (PO) is created and assigned to:
    (1) project wbs element
    (2) asset
    Upon GRS, the following accounting document is NOT posted:
    (1)Cost accounting doc.
    (which in ECC5 is termed Controlling Document)
    As a result, I am unable to track the Actual Cost line item of the wbs element via transaction CJ74.
    This is because in normal instances, a corresponding CO document posted for the FI document posted upon GRS. What I understand is that CJ74, pulls data from CO tables and because CO tables aren't updated, I can't view this statistical cost postings.
    I would appreciate if anyone could advise the following:
    (1) Why this occurs in ECC5
    (2) How to rectify the problem
    Thank you.

    Hello,
    Make sure in OBYC, for key WRX, you have maintained the GL accounts.
    Regards,
    Ravi

  • Error saving: The location of the document " DOC NAME " cannot be determined.

    I am having issues saving .pages files on to our network drive after upgrading to Mavericks and Pages 5.0.
    A bunch of errors and issues occur when editing old or saving new pages files on our local SMB server. Saving files on to my local machine is fine.
    I cannot save to the original network location at all. It errors: The location of the document "<DOC NAME>" cannot be determined. The folder in question has permissions that have always worked before the upgrade of mavericks/pages. I can rename the files in question, and save other types of files in to that folder without issue.
    When it errors, it provides the option to Save as... this also fails, no matter where I try to save it to - local or network.
    The auto-save feature fails for the same reason. This creates several temp folders with blank pages documents in it.
    Most disturbingly, it appears to be destroying the original file by renaming it to a temp file, that is henceforth un-usable. Luckily Ive got backups of the documents.
    Help!

    Update:
    The new version of Numbers also comes up with the same errors.
    The previous version of both Pages and Numbers work absolutely fine still - have had to revert to using these for now.

  • Document Set name as refiner in Search results?

    I'm wondering if there is a way to use the document set name as a refiner in a search results page so a user can search a specific site or document library and choose the document set name to narrow the results? Initially I thought I could create a
    shared column on the document set (in the properties of the document set type itself) which looked up or calculated the document set name and then this would be shared with the documents within the set. I couldn't find a way to get the name of the set.
    What would be the best way (if any), of getting the search results or document properties themselves (if I created a column which contained the document set name for e.g.) to show the document set (if populated) that the document belongs to?
    Document Library
    Document 1
    Document 2
    Document Set A
         Document A1
         Document A2
    Document Set B
         Document B1
    How can I get search results to show a refiner on Document A1 and A2 indicating they're in the same Document Set A? I realise I need crawled/managed property but how best should I set this up?
    If this is not possible can anyone suggest an alternative please?
    Many thanks!
    Scott

    Hi,
    I am afraid that there is no existing managed properties on the document which we can count on to know which document sets the document belongs to.  Just like what you said "created a column which contained the document set name", this could
    be a workaround to achieve what you want.
    To do that:
    1. Add a new site column named DocumentSetName and add it to
    DocumentSet Content Type. And give value "DocumentSet_A" for document set A and "DocumentSet_B" for document set B.
    2. In the Document Set settings, enable the newly added column as
    Shared Columns. It means that all documents added to this document set will share the column and its value.
    3. Reindex this document library.
    4. In the Search Results refiner, add the automatically created Managed Property
    as Refiner. 
    With this method, you can filter the documents with the name of document sets when searching office documents in search center. The only information you need input manually is Value of the site column.
    http://blogs.technet.com/b/sharepoint_made_easy/archive/2013/03/19/step-by-step-configuration-to-add-custom-refiners-in-the-refinement-panel-of-search-results-page-for-sharepoint-online.aspx
    Moreover, if you have the requirement to create batch of DocumentSets without any manual input, you can refer to the following link which explain how to create them with proper settings and default values.
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    Miles LI TechNet Community Support

  • Print document's name in Event Log ID #307 on Server 2012

    Creating a new printer server using Windows Server 2012.  Everything is working out fine so far, however I just ran into one problem that didn't happen in our Server 2008R2 print server.
    When looking at print jobs that have completed under:  event logs --> Microsoft --> Windows --> PrintService --Operational, I have noticed that Event ID 307 is not displaying the printed document's name in Server 2012 (it did for Server 2008R2). 
    In Server 2012, the document name simply displays as "Print Document" instead of displaying the document's name.
    Anyone have any ideas on how to get the document's name to properly display in the event logs?
    Thanks for any help.

    Hi Alan,
    I have configured a Server 2012 R2 standard as print server to manage printers and Monitor the print usage of users, however I am not getting the Print logs (Event Log ID 307) in the default event logs directory on the print Server.
    I perform some search and come to know that it’s a known problem in Server 2012 and there is Hotfix available. I installed the Hotfix mentioned here
    http://support2.microsoft.com/kb/2938013/en-us , but still logs are not getting generated.
    I also made the below setting for the logs.
    Creating Registry entry
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows NT\Printers] "ShowJobTitleInEventLogs"=dword:00000001
    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers] "ShowJobTitleInEventLogs"=dword:00000001
    The policy name: Computer Configuration \ Administrative Templates \ Printers
    Allow job name in event logs
    Keep printed Docs setting is also enabled on all the printers installed on Print Server.
    Noting seems to be working here or am i doing something wrong here.
    Regards
    Mukesh

  • Is there any reason not to use spaces in document file names anymore in a document library?

    We are revamping our sharepoint document library file naming conventions. In lots of blogs and tutorials, I have seen over and over the recommendation to use underscores instead of spaces in document file names in sharepoint. Part of this is I think to prevent
    the infamous %20 in URLs pointing to the documents. That doesn't really concern us and we don't generally have file names that approach 256 characters.  We don't want to go the route of having different document names than document titles so we want our
    document names to be a clear and readable as possible. We think that using spaces (and occasionally dashes) in the file names makes them more readable, and sharepoint 2010 seems to be able to search these file name correctly.  An example document file
    name would be "elephants - how to clean elephant cages".
    Has anyone run into a reason to avoid using spaces and dashes in document file names in sharepoint 2010? I don't want to start using spaces and then be sorry I did down the road. Thanks!

    It isn't going to lead to the fall of western civilisation.
    You will get longer and messier URLs for documents but it's very unlikely to cause issues. There have been some bugs in the past where hyphens in particular can be mis-encoded in searches but they only affect a small range of build numbers if memory serves.
    I much prefer using no spaces for document libraries as it makes the starting URLs so much cleaner but that's a style question. For documents unless you've got a very strict document naming standard spaces are common and dashes aren't uncommon.

  • How to get the document type, name and revision from the search page cv04n

    Hello,
    After performing cv04n and getting a list of documents satisfying the search criteria, how can I then get the document type, name and revision of the selected document using ABAP?
    Thanks

    HI,
    IN table DRAW... u have Document type, Version and document number.
    In Table DRAT also u get Document Type, Version, Number and Description of Doucment.
    Regards
    SAB

  • Exchange rate problem in controlling document

    Hi Friends
    I have posted CJ45 (over head run) and posted documents in cost center and pca.
    we wanted to know which exchange rate was taken for posting in different currencies (Controlling area and PCA).
    Can any one please help me any table where can we find co document posted amount with exchange rate considered?
    Advance thanks!
    GK

    Hi,
    Controlling Document can be checked in Table COEP (CO Object line item table).
    PCA: Table GLPCA
    Hope this helps.
    Thanks,
    Ashok

  • Exchange rate for controlling document.

    Hi,
    We have 3 currencies in total, 1 local  2 other currencies in USD. During posting system automatically converts local currency amount into USD based on exchange rate available. suppose if this USD amount is manually changed during posting and posted, controlling document (cost center document) is still considering the exchange rate available in system and not manually changed amount. This is leading difference between FI and CO in USD amount where as Local curr amount matches. I checked all the controlling settings.. versions etc to avoid this, but couldnt succeed. Can some one advise if this is standard behavour ? can this be changed by some customisation ?
    thanks

    HI
    Yes this is the way SAP works.  You need to reconcile with local currency . However if you want to reconcile with other currency too , you can use the same rate which is being used for transfer of the data into CO. You may have Audit issue in such case , however currency re valuation will take care this aspect too .
    Regds
    Rajiv

  • How to Create an XML document from XSQL servlet which follows a particular DTD struct

    how to Create an XML document from XSQL servlet which follows a particular DTD structure.Could anyone send me a sample code for this.

    You'll need to associate an XSLT transformation with your XSQL page that transforms the canonical result into your DTD-valid format.
    For example, given an XSQL page like:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="rss.xsl" ?>
    <xsql:query max-rows="3" connection="demo" xmlns:xsql="urn:oracle-xsql">
    select title,id,description,url,to_char(timestamp,'Mon DD') timestamp
    from site_entry
    order by id desc
    </xsql:query>and an "rss.xsl" stylesheet that looks like this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" doctype-system="rss-0.91.dtd"/>
    <xsl:template match="/">
    <xsl:for-each select="ROWSET/ROW">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    <xsl:for-each select="ITEM">
    <item>
    <title><xsl:value-of select="TITLE"/></title>
    <link><xsl:value-of select="URL"/></link>
    <description><xsl:value-of select="DESCRIPTION"/></description>
    </item>
    </xsl:for-each>
    </channel>
    </rss>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>You produce DTD-valid output against the rss-0.91.dtd DTD that looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE rss SYSTEM "rss-0.91.dtd">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>

  • Controlling document creation on SD invoice creation ( vf01)

    Hi gurus
    How to to activate "Controlling document creation" ( cost center & Cost element ) on invoice creation ( vf01) . ( like accounting document is created on vf01).
    thanks

    Hi BR,Ajay M
    thanks.
    Cost Element : Cost element category 11 is revenue .    and Cost element category = 1  is  "Primary costs/cost-reducing revenues"
    I want to use it in  Freight Discounts to customer.  ( sales Invoice ) ,.   ( i think it should be cost reducing revenue ). plz advise.
    Thanks.

Maybe you are looking for

  • ITunes quits when I plug in my iPod Nano

    Good day, When I plug in my iPod nano, iTunes opens and starts to sync my iPod and then after about 6 secs iTunes closes unexpectedly. My iPod is no longer visible on my desktop even though it is still plug into my computer via a USB port. I have uni

  • How to move data from 2 internal table to 1 internal table

    Can any body send me code that how to move data from 2 internal table into one internal table. Moderator message : Read ABAP documentation. Thread locked. Edited by: Vinod Kumar on Jun 13, 2011 11:45 AM

  • How does one move a scanned document from the scanner to the SD card?

    I use a DELL laptop, plus the DELL All in One printer Model 922. I can scan something but then I would like to place it on my card for viewing on my TX.  I do scan it as a picture. Is there any other way? Is there another application I should be look

  • File Watcher issue...

    I am hoping someone can nail this or point me in the right direction because I seem to be hitting a brick wall... Until last night I was successfully using my file watcher job and then it just stopped "watching" for some unexplainable reason. The fil

  • Upgrade from ECC 5.0 to ECC 6.0 FICO

    Hi, Can anyone provide me the configuration documents with regard toUpgrade from ECC 5.0 to ECC 6.0 in  FICO or brief the steps to be done. Plz do reply me at the earliest. my email ID: [email protected] thanks suresh arya