Content-Disposition not working!

Hi!, I've a servlet which its purpose is to read a file and write it later using a ServletOutputStream. This file must not be wrote as text, but instead the idea is to write it and then browser open it with a specific application. The extension of this file is already asssociated with the program that I want to use to open it. In fact, if I use a url link to the file, the browser requests the application and all goes fine, but I want that this application runs inside the browser, so I'm using content-disposition: inline; in order to do this, but I can't make it! The browser always try to download the file. My code is this:
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class imflpruebas extends HttpServlet{
     private ResultSet rs, rs2;
     private Connection connection;
     private Statement statement;
     public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
          doPost(request,response);
     public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
          response.setHeader("Content-Disposition","inline");
          response.setContentType("application");
          String sFileName = "F:\\jakarta-tomcat-4.1.24\\webapps\\ImaxFileWeb\\temp\\reno_PRUEBA_0_0_0.IMX";
          File file = new File(sFileName);      
          byte[] byteContents = new byte[(int)file.length()];                
          FileInputStream in = new FileInputStream(sFileName);                
          int retcd = in.read(byteContents);                
          in.close();
          ServletOutputStream out = response.getOutputStream();
          out.write(byteContents);
          out.flush();
          out.close();
}          I've tried to put the content type before the set header and the result is the same.
Any ideas?
Best whishes
Raul          

Hello Raul,
There are a few things to consider. First of all, how do you want the browser to tell which application to use. Your content-type is very non-specific so the browser would never be able to tell by itself. Using a mime-type which has been mapped to an application might do a lot.
Second, if you are using IE mime-types have little influence. IE tries to recognize the data by looking at the raw bytes and see if it recognizes the format. If not, IE will look at the URL and determine what to do with the data based on the URl extension. So if you have a link http://..../xxx.xls IE will try to show the data using Excel (if installed obviously). Adding such an extension (that can be ignored by the servlet) can do the trick with IE.
If using IE check the Windows Explorer file settings (based on extensions). There is an "advanced" property called "confirm open before download" which should be cleared to allow an automatic open. Clearing the check "always ask before downloading" on the browser popup has no effect at all.
Hope this helps.
Regards,
Silvio Bierman

Similar Messages

  • Web Content Source - Not Working

    Created a new web-content source & full crawled it.
    When i searched with content text, not working.

    Hi ,
    According to your description, my understanding is that it did not work when you searched a new web site content source in SharePoint 2013.
    Please check whether the web site allows anonymous access to its content. If not, we need to configure a rule for the URL which allows us to enter the credential to access the content of site
    More information, please refer to the link:
    http://mohitvash.wordpress.com/2012/03/07/configure-external-site-as-content-sources-in-sharepoint-search/
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Web Part with Flash Content is not working in IE only

    Hi All, 
       I have created on Visual WebPart its contain a flash embed object i am trying load this flash component inside the Iframe.
    unfortunatly its not working in IE 11 version but its working fine with other browser like Mozila and Chorme.
    I referred the other links like but its not helped me to solve this issue. i have tried without iframe alos its not working if its a standalone web page out side the shrepoint working fine.
    https://social.technet.microsoft.com/Forums/office/en-US/c88466ba-bd00-4cd3-a7cf-3a9a7eee7f51/flash-content-not-working-in-ie-11?forum=ieitprocurrentver
    Thanks 
    SUJIL KUMAR T
    Software developer

    Hi,
    As the custom web part works well in other browsers, the issue may be related to the IE itself.
    Have you tried the methods below?
    Use compatibility mode to check whether it works.
    Open IE->Tools->Compatibility View Settings
    Add the site into Trusted sites to check whether it works.
    Open the IE->Internet Options->Security->Trusted Sites->add the site into the zone
    What’s more, you can also switch the Document mode to IE 10 or lower to check whether it works.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Display Content is Not working in BI 7.4

    Hi All,
    In BW 7.4, I am trying to display content via Mange Infoprovider. Till 7.3 the data used to show in the BW system itself.
    Where as in 7.4 BW system display data redirecting to below URL and it’s calling a webdynpro APP called “rsdmdm_md_maintenance_app” as below URL
    http://host:port/sap/bc/webdynpro/sap/rsdmdm_md_maintenance_app?IOBJNM=ZDV_EMPID&sap-language=EN.
    Bu this URL giving 500 Internet server error.
    Can any one help with what I am missing here? In 7.4 is it possible to display content in BW system itself?
    Thanks in advance.
    Venky

    Hi,
    Please review following SAP Note. The new behavior (WebDynpro based Master Data maintenance) is now standard since SAP BW 7.4 SP05. Old SAPGui based screen is not possible anymore.
    The notes describes the SICF services you need to activate to make it work.
    My understanding is that old SAPGui based screen could not handle certain newer data types. As per SAP the new feature has some good benefits such as copy/paster multiple lines from spreadsheet.
    1997402 - Master data maintenance is not possible in old GUI based
    one
    1969105 - Master data maintenance for InfoObjects does not
    start
    517484
    - Inactive services in the Internet Communication Framework
    1969092 - Exception when launching master data maintenance for some
    InfoObjects; additional option for navigating to application log
    Hope this helps.
    btw: I only found out this week hard way as we just did SAP BW 7.4 upgrade. :-)
    Thank you with kind regards,
    Satya,
    Resolution
    It’s not possible to switch to old GUI Based Master data maintenance. Incase
    if new master data maintenance is not working please check:
    Check if services as described in note 517484 is active
    In transaction SICF activate services starting with RSDMDM*
    Check if note 1969092 is implemented already.
    See Also
    Additionally the new UI has some advantages like editing values directly
    within the tables, so it’s not required to edit the values one by one,  or the
    option to copy and paste values from a spreadsheet directly in to table.

  • Save a published Access services database site as a template with contents does not work

    Hi
    I have a Access site on the SharePoint. I wanted the site to be duplicated to another subsite, I then did the usual - save site as a template with contents and made a copy of it, however it does not work. I have been getting the error as stated below
     error has occurred during report processing. (rsProcessingAborted)
    Query execution failed for dataset 'Default'. (rsErrorExecutingCommand)
    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    However, it works if I make a local copy and publish it to the subsite? How does access services work on SharePoint and why the template option can't be chosen.

    Hi cally, check the following links for possible solutions:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/1e2b77ba-4cfa-4aa3-97e4-b7b39fbd46fd/error-with-ssrs-report-that-has-a-sharepoint-list-data-connection-ssrs-r2-and-sharepoint-2010?forum=sqlreportingservices
    http://blog.mikehacker.net/2012/05/16/sharepoint-2010-access-services-reporting-with-sql-2012/
    cameron rautmann

  • RV220W - Content filtering not working (?)

    Hello, I bought a router model RV200W fw 1.0.1.0... nice toy.
    It all works very well with the exception of content filtering. The rule only works if connections are made with the HTTP protocol, but if the user connects with HTTPS, then the rule is not considered... (???)
    f.e.:
    http://facebook.com (content filtered)
    https://facebook.com (content NOT filtered)...
    What the hell ! where I'm wrong ?
    Does anyone is experiencing the same ?

    Yes, the correct title was "URL FILTERING NOT WORKING"...thanks abudef000
    I do not want be polemical, but I do not understand where I went wrong.
    Before I buy I looked @
    http://www.cisco.com/en/US/prod/collateral/routers/ps9923/ps11025/data_sheet_c78-630461.html
    Check it out.
    Could you assume that HTTPS URLs are not in the sentence "Static URL blocking, keyword blocking, approved URL" as stated in the product sheet ?

  • Content Server not working after 5.0.2 upgrade

    We upgraded the plumtree to 5.0.2. After upgrade, content server portlets not working properly. When I publish my portlet, Interface says it is published, HTML file generated at the published location, but log says
    com.plumtree.search.UnknownTypeException: IndexManager.enqueue() : Could not find PTDocMaker for key PTCONTENT
    Portlet displays
    Error: No Url is available for this portlet. It may not have been published.
    Any Idea ?

    Hi Ravi, from the Release Notes for Content Server 5.0.2, there's this note "Publish Dialog does not show any error when search index fails but an error "com.plumtree.search.UnknownTypeException: IndexManager.enqueue() : Could not find PTDocMaker for key PTCONTENTTEMPLATE" is recorded in pcs.log. (Issue #27541) "
    So you should make sure that the search server is running (just by doing a banner search). Assuming that's fine (it probably is), the likely culprit is an installation problem. Check the Content Server pcs.log file (located in PT_HOME\ptcs\5.0\settings\logs) for any error messages related to search api initialization. This cryptic error you're observing occurs when the search api initialization fails for some reason, the error is not gracefully caught and surfaced to the user. The pcs.log file may give a clue.

  • Content Assist Not Working

    Content Assist does not work for me in Flash Builder 4.5 on Mac OS 10.6. For example, I type a variable definition and get no suggestions for variable. Type.
    Content Assist does work if I create a new project and a new class, but even with that it stops working at some point (after a save?).
    I've tried restarting FB and running the -clean command.

    Thanks for your help, but in preparing a response I figured out files need to be in "src" to have content assist. My project had been imported from a Flash project and the files were at the same level as "src" and not inside "src".

  • Adobe Premiere Pro CS 5..5 - Content Analysis not working

    I am trying to get Adobe Premiere CS 5.5 to analyze an MP3 and provide me the text. I import the MP3, add it to a sequence and then select the "Analyze Content" option which spins off the Adobe Media Encoder (AME). After the file is "encoded" by AME which I have confirmed by having it create a new MP3.
    Question: I don't see anything on the metadata window back on Adobe Premiere CS 5.5, do I need to load up the newly created and encoded MP3? I tried that, but that did not work.
    Please provide me some pointers.
    Also, I am looking to do the same for 40-50 MP3s. I believe I can queue them up in AME and have it encode them all at once?
    Below please an image from my Adobe Premiere IDE screen
    Thanks
    Anye
    [email protected]
    Message was edited by: angelo guevara

    You can download and install the software.  The serial number from the DVD can be used to activate it.
    CS5 - http://helpx.adobe.com/creative-suite/kb/cs5-product-downloads.html

  • Premiere Elements 11 - online-content-download not working

    Download of online-Content (movie-menues etc.) is not working. Are the Servers down?

    premiere-user-v11
    Are you doing one at a time and getting failure or are you hitting the All choice for the Content with the blue ban at its upper right corner?
    Have you checked the following areas to determine if the problem is targeted at one type of Content?
    Graphics Tab for Clip Arts
    Tools Menu or Tools Tab for DVD Templates
    Instant Movies Tab for Movie Themes
    Title & Text Tab for Title Templates
    Just trying to determine the specificity of the problem - All versus selected areas.
    I have found that, at best, the Content download from within the project is a labored and slow process, depending on your Internet connection and Internet speed. Unfortunately there is no alternative since there is no more Content disc when you purchase the box product. But you can save the Online Folder (after download - completed version) to a USB Flash Drive (8 GB capacity) after the first program install so that you can use that for Content for the second install of  Premiere Elements 11 on another computer or in the case where you need to uninstall reinstall Premiere Elements and its Content on one computer. The file size of the completed Online Folder is expected to be about 6 GB.
    We will be watching for your progress.
    Thanks.
    ATR

  • Content filter not working

    I recently got my two teenagers a Droid Maxx and they love it. My question is if anyone knows why the content filter option doesn't work for it. You would think the content filter would work on all phones. Seems to me that prior to releasing any new phone they should have made sure all features of the Verizon account would work. Does anyone know if they are going to resolve this issue and if so when??  I do think it is irresponsible for the feature to not work considering the number of kids using cell phones now. How can a parent who wants to control content do so if not available. I think this should be a priority with Verizon. Do they value kids safety or not?

        Hey there, skyhawk1! Thanks for your purchase of two new Droid Maxx smartphones. I hope your teenagers are loving them! I'm very curious about the crux of your post here. You've expressed interest in Content Filtering, and stated that the service is incompatible with the Droid Maxx. Our records indicate that the model will support filtering. Can you tell me why you feel that it doesn't? Did you attempt to add or request it, only to be denied? Please share the details. Thanks!
    For more info on Content Filtering, please review this link: http://vz.to/17xz67N
    DionM_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • InCopy CS5.5 update content does not work

    I am an editor using InCopy for editing my magazine. I only have InCopy. My art director who uses the full InDesign suite, and I work remotely. She sends InCopy files to me via Dropbox. When she makes changes to the files, my content update does not work. It is shaded grey. It worked a couple of times and then stopped. Does my art director need to do something on her end to ensure I can update content in files she sends to me?
    Thanks for any help someone can provide.

    Hi and thanks for the quick reply.
    This is the problem:
    My art director is using Indesign to create Incopy files for me to edit. We
    both are working from remote locations and are using Dropbox (remote server)
    to store our files. We have been having some problems... When my art
    director changes an image I do not see the image change/update on my end.
    How do we solve this problem?
    We are both using the latest version of the software she is using InDesign
    CS5.5 and I'm using InCopy CS5.5.
    Thanks for your help.
    Cheers,
    Mary
    Mary Scianna
    Editor, Shop Metalworking Technology Magazine
    Latest issue: http://shopmetaltech.dgtlpub.com
    Vice President, Zedcom Media Inc.
    Tel: 647 932 4477
    Cell: 647 408 6137
    Email: [email protected]
    Web: www.shopmetaltech.com
    Mary Scianna Courier Address:
    416 Whitby Shores Greenway,
    Whitby, ON L1N 9R5  Canada
    Mailing Address:
    1450 Headon Road, PO Box 93171
    Burlington, ON L7M 4A3  Canada

  • I cannot see why DVD @CCESS and DVD-ROM content are not working properly

    Hi,
    I am very new to DSP, and I know I am missing a piece of the jigsaw, but I do not know what it is. I used a tutorial from creative cow to try and make the @CCEESS function work, but no dice… for now at least. When I did a build/format (to the HDD) everything went fine. I mounted the image, and I could see the DVD @CCESS folder and the DVD–ROM content on the DVD image. When I went to play the image, the button did not work. The content I am trying to use with @CCESS is a PDF file.
    The tutorial I followed was this: http://library.creativecow.net/articles/alexzander_alex/dvdaccess.php
    By the way, I am using is 4.2.2
    Help or just counsel is appreciated.

    As Eric said - DVD@ccess is really not that useful. It was a way to get documents like PDFs to automatically launch in the application (like Acrobat) when watching a DVD on a computer. Since they can't launch on a set top player the technology was already limited. Then the whole issue of getting it to work on a PC arose - it simply wasn't reliable. I managed to produce one disc that was replicated with @ccess links, but I knew the parameters for it's use in advance and managed to get it to work. It doesn't work on modern machines.
    For a while there was a Sonic app which was much better at getting this sort of thing to work, but you had to work on a OC to set it up. Sonic pulled the app shortly after I bought it (sigh) and never replaced it. The fact is, automating document launches and web links is actually pretty tricky on a DVD, the results were variable and it never really enhanced your discs like you wanted to think it would!
    If all you want to do is include a PDF file on the disc, and alert viewers to it being there, you only need to use the ROM content functions not @ccess, and you can use a menu screen to give instructions to people to let them know how to find it.

  • Abobe content viewer not working in Micromax Funbook

    Dear Sir,
    Adobe content viewer app is not working in following devices:
    1.Micromax Funbook (480 x 800 pixels, 7.0 inches,Android OS, v4.0.3 Ice Cream Sandwich)
    2.Karbonn smart tab (Android, v4.0.3, Ice Cream Sandwich,7 inch LCD Capacitive Touchscreen with 800 x 480 pixels)
    3.Magic X100 (ANDRIOD 4.0.3 ICS,10” TFT display , 1024*600)
    How to overcome this problem?
    Best Regards
    Gautam
    Cadgraf Digitals Pvt Ltd

    Dear Mr. Christophe
    We are using the following android devices, where downloaded the content veiwer V23.
    1.Micromax Funbook (480 x 800 pixels, 7.0 inches,Android OS, v4.0.3 Ice Cream Sandwich)
    2.Magic X100 (ANDROID 4.0.3 ICS, 10” TFT display, 1024*600)
    When we open the content veiewe, it is getting closed.
    In Karbonn smart tab (Android, v4.0.3, Ice Cream Sandwich,7 inch LCD Capacitive Touchscreen with 800 x 480 pixels), the content viewer app is not showing for download.
    How to overcome this issues.

  • Help! ipad content viewer not working!

    we've using DPS for years,  yesterday the content viewer on ipad is not working, we can't see all the foilos which we made. iPad is iOS 8.1.3, and the content viewer app is updated. How can we fix this problem? help~
    many thanks

    Also just because they are showing in Folio Builder Panel does not mean they will show up on the iPad. You may have accidentally created them as local folios, and they must be uploaded to our systems before you can see them in Adobe Content Viewer.
    Did you make sure your folios created in InDesign are uploaded to our servers? (in the Folio Builder Panel flyout menu select Upload)
    Neil

Maybe you are looking for

  • Looking for a free iPod to iTunes music transfer utility, any suggestions

    Looking for a FREE utility that will allow me to transfer music from my iPod to my iTunes. I recently purchased a new notebook PC that I recently download a fgresh installation of iTunes. Now I need to transfer my music stored in my iPod to iTunes. I

  • HP LaserJet M2727 Multifunct​ion Printer series

    When printing from the printer device stopped permanently عندما اقوم بالطباعه على الطابعه تطفى فجاءه نرجو دعمكم

  • CanoScan LiDE 200 - can't get it to work with 10.6.6

    I have a CanoScan LIDE 200 and recently upgraded to 10.6.6, and now I cannot get the scanner to work. I spent 3 hours downloading all the latest drivers and even the Canon IJ Network Scanner Selector. Everything I tried failed and now I'm losing pati

  • Problem with with characters being interpreted wrong

    Hi, I am developing a website and currently when a search is made, all the occurancies of an apostrophie or a hyphen are being shown as a question mark. And the int value of them is -1. I think the person who put the content into the browser editor f

  • Website security problem

    On one particular website I get told that the security certificate can't be trusted. When I try to add an exception I get told that there is no need to add an exception, and indeed the exception box is greyed out. So I am blocked from accessing the w