EmailReceiver QPAC doesn't retrieve 'content-disposition: inline' attachments

Hi,
[Note: this is kind of a follow-up thread for
Email receiver QPAC does not retrieve attachments other than .jar. Thought, I better post a new thread.]
I experimented quite a lot with the Email Receiver QPAC. Regarding my testing, it seems as though it doesn't recognize attachments from emails, whose
content-disposition is set to 'inline'. In fact, if I set the content-disposition to 'attachment', then the same attachment in the same Email sent via the same Email server is retrieved.
Does anyone experienced this as well?
Does the EmailReceiver QPAC actually retrieve 'content-disposition: inline' attachments?

Hi Howard,
thank you for providing the new version!
We'll contact support then. Since some popular email clients like Thunderbird are set to 'content-disposition: inline' by default but we don't want our users having to adjust their client settings rather trickily, it's pretty important to us that the EmailReceiver actually handles inline attachments.
Regards,
Steve

Similar Messages

  • Content-Disposition inline Not working

    Hi all,
    I am using Orion application server as Web server. I like to open a file in client side form the server. Which one is known MIME type. I don't want the IE to prompt the user for Save as/ Open from the current location.
    I am using "inline" argument in Content-Disposition header. Eventhough i am getting promt dialog box in client side.
    The following is my code.
    <%@ page import="java.io.*" %>
    <%@ page import="java.net.*" %>
    <% response.setContentType("application/pdf"); %>
    <% response.setHeader("Content-Disposition" , "inline;filename=test.pdf" ); %>
    <%
    String fileURL = "http://java1/examples/jsp/test.pdf";
         ServletOutputStream sout = response.getOutputStream ();
         URL url = new URL ( fileURL );
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
         try {
              URLConnection conn = url.openConnection();
              // Use Buffered Stream for reading/writing.
              bis = new BufferedInputStream(conn.getInputStream());
              bos = new BufferedOutputStream(sout);
              byte[] buff = new byte[2048];
              int bytesRead;
              // Simple read/write loop.
              while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                   bos.write(buff, 0, bytesRead);
         catch(Exception ex){
              System.out.println(ex.toString());
    %>
    Any one give the soloution for this problem. I hope there is no problem with the source code. I want to avoid the dialog box while downloading in the client side.
    Thanks
    Prabhu.

    Hi,
    Please let me know in which browser you are trying to do this, since it as some problem with IE5. You can try this, using the Netscape browser which doesn't have any problem.
    Hope this helps.
    Senthil Babu J

  • Content-Disposition inline/attachment

    I am using Content-Disposition for excel file download as below:
    I have searched the forum but not able to get the exact answer or solution. Please also guide me to some url if possible.
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "inline; filename=xyz.xls" );
    If I am using inline attribute but I am not able to specify the filename as xyz.xls and by default fileName provided by browser is the request URL(action-mapping in case of struts).
    But it works fine with attachment attribute and prompts for the exact file Name and works fine.
    I want to know how to specify the desired fileName with inline Attribute ? I am using the struts based request for Excel file generation.
    Best Regards,
    Amber Gupta

    if You dont't mind , I just want to tell u something on this code.
    If im wrong, Please tell me why? and what is the best way of acheiving it then,
    the code below loads whole filedata and it does not matter how big the file is. Don't you think that it will heat up the memory by doing so. and consider the method what he was doing is perfectly right. but is there any other solution/wrong with above code what MR/ms/Mrs Kenneth has written like.
    I just wanted to know the answer what is the wrong with MR. Kennth Code since i looked at it as a perfect working code(but with some glicth).
    with Regards
    Lokesh T.c
    FileInputStream in = new FileInputStream(fileToDownload);
    ServletOutputStream out = response.getOutputStream();
    int bytesRead = 0;
    byte byteArray[] = new byte[fileTODownload.length()];
    // Read in bytes through file stream, and write out through servlet stream
    /*while( ( bytesRead = in.read( byteArray ) ) != -1 ) {
    out.write( byteArray, 0, bytesRead );
    in.read(bytesArray,0,fileTODownload.length());
    out.write(bytesArray,0,fileTODownload.length());
    in.close();
    out.flush();
    out.close();

  • Inline type of Content-Disposition problem in IE

    Hi,
    In a project, we need post some information from applet to servlet. The servlet will send some files back. We like the files shown on browsers. So we set the header in servlet as
    response.setHeader("Content-Disposition",
    "inline;filename=\"" + fileName + "\"");
    We use JSobject in applet to call form from a html file to post the information to servlet, target of the form is set as "_blank", which suppose will open a new browser and show the file. For example if the file is a word file, the IE will show the file inside browser.
    However, if two files need to be shown, only the first file is shown, the other browser is blank, and when you kill the blank window, the other will turn to blank window too. We test other types of file, xls files have similar problem, the PDF files work OK. Two things can fix the problem, one is set the form method to ��get��, the other is changing the header from ��inline�� to ��attachment��. But we can't use any of them under the project requirement. Has anyone experienced such wield behavior and know the reason? Is this the bug of IE?
    Thanks in advance!

    Here are a little more about the file types.
    The files we test have problems are msword or excel files, I think all MS office type files have the problem. Same problem even you mix them, for example one word file and one excel give you the same problem as two word files.
    However there is no problem if I view several PDF files. If we mix the word file with pdf file. If the first file to view is PDF, then it works OK. Otherwise same problem.
    The browser we are testing IE 6.0 with SP1.

  • Change content-disposition in email attachment

    I am using apex_mail (in Apex 4.1) to send emails with an attachment.
    v_mail_id := apex_mail.send(
             p_to  => '[email protected]'
             ...etc...
    apex_mail.add_attachment( p_mail_id    => v_mail_id
                             ,p_attachment => v_image
                             ,p_filename   => 'signature.jpg'
                             ,p_mime_type  => 'image/jpeg');
    Apex creates this as an attachment:
    Content-Disposition: attachment;
    I would like to change it to inline:
    Content-Disposition: inline;
    so I can reference it in my email body with <img src="cid:signature.jpg"/>. Well... I hope it is going to be shown inline anyway if I change Content-Disposition.
    Currently (with Content-Disposition: attachment;) it works for Outlook, but, for instance, not in Gmail in the browser. Gmail shows the image separately as an attachment.
    Is there a way to change the content-disposition with Apex?
    I know it is possible to do it with utl_mail, but this is currently not installed in our databases. I need to involve our DBA to set this up, and I don't know if he is willing to do that.

    Hi Joel,
    I thought so. I will put this in the Apex feature request database.
    Ino
    BTW, for other people it might be interesting to know that there is another option I tried that doesn't work in many situations either. You can put this in the email body:
    <img src="data:image/jpeg;base64,'||v_image_base64||'"/>
    where v_image_base64 is the base64 encoded jpg image.
    From my experiments the inline attachment with a cid reference seems to work best.

  • ParseException Content-Disposition filename spaces

    Hello All,
    I have an email generated from Thunderbird 1.5.0.9 (Windows/20061207) which contains an attachment whose filename has spaces.
    JavaMail (1.4) throws a javax.mail.internet.ParseException on the MimeBodyPart.getDisposition() call:
    javax.mail.internet.ParseException: Expected ';', got "-"
    javax.mail.internet.ParameterList.<init>(ParameterList.java:179)
    javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:87)
    javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:1039)
    javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:299) The offending attachment part has a part header which looks like this:
    Content-Disposition: inline;
         filename*0=Test - Test.pdf
    Clearly the parser is failing due to the spaces in the filename. Bugzilla for Thunderbird (Bug 221028 - https://bugzilla.mozilla.org/show_bug.cgi?id=221028) discusses this issue, however the status of the bug is VERIFIED WONTFIX.
    According to the Mozilla discussion, their implementation is conformant to the RFC:
    ...Just two days ago I was talking about this issue in #mozillazine with Christian
    Biesinger and Boris Zbarsky, and they said that this is the proper behaviour
    according to the RFC...
    Whether it IS conformant to all relevant RFCs I don't know, but it seems it won't be changed any time soon.
    This issue also exists for the Content-Type header in the same email which has the same format:
    Content-Type: application/pdf;
         name*0=Test - Test.pdfAnyone know if there is a way I can "safely" parse these headers? Is this a JavaMail bug?
    Thanks

    Absolutely, and please don't take my posting as a complaint - well over 99.9% of our emails are consumed flawlessly. I'm expressing more of (my opinion only) a high-level philosophical argument about of why I think good software (JavaMail) should try to by-default interact with not-so-good software. I'm not basing this not on "technical correctness", but rather the following unfortunate scenario:
    One particular example would be certain products made by a company with the initals "MS". These products almost always hide brokenness (they act as highly liberal consumers). Outlook, Internet Explorer, are the 2 primary examples. So a user (and unfortunately most users have never read or care about an RFC) opens the email with Outlook, or the web page with Explorer, etc. It "works". Now, we programmers certainly know better, but remember that we aren't buying or choosing products or services, we're offering them. User then opens with Java-based product (stack trace). User buys or chooses MS-based product, MS-based product retains market stranglehold, commercial email providers test their products with Outlook, and in the end, brokenness is propagated anyway. It's kind of like reverse-Darwinism for software (survival of the most-broken).
    Some customers complain that JavaMail doesn't strictly enforce every requirement of the standards
    As an SMTP producer, I might see that, but personally I can never recall seeing a single problem with outgoing email from JavaMail. As a client consumer, I'm not sure why they would take that philosophy, unless maybe they are using JavaMail to test RFC-compliance.
    there are forms of brokenness that go beyond what can be handled at the JavaMail API level.
    Of course, but I have yet to see a message that the "MS" client could not read. So perhaps they are working around some of these at a higher level (in the GUI, maybe?)
    But for developers who don't think about this problem...
    Most developers most likely aren't using JavaMail to read in over 25,000 emails a day. So admittedly, I'm in a unique situation.
    Having made that decision it's relatively straightforward to configure JavaMail appropriately. Not really, one change required updating the jar file, others require obscure uses of the API. And a developer/administrator is only going to make those changes after seeing the problem.
    to avoid propagating brokenness as you suggest.
    Brokenness will get propagated anyway (see reverse-Darwinism, or the Theory of De-evolution above).
    I'm looking forward to trying out 1.4.1, and thanks again for all the assistance, a very thorough FAQ, and overall a great API. I think the opensourcing was a good idea, JavaMail really is by far the best API that I have seen for this type of high-volume work.

  • Download File by url in another server? (Content-Disposition","attachment)

    Can the file be downloaded by a url in another server?
    ie.
    Server A: JSP program
    Server B: filepath + filename = "http://xxx.com/xx/x.doc"
    e.g.
        response.setContentType("APPLICATION/OCTET-STREAM");
           response.setHeader("Content-disposition", "inline" );            
           response.setHeader("Content-Disposition","attachment; filename=\""+ fn.trim() + "\"");     
              java.io.FileInputStream fileInputStream =new java.io.FileInputStream(filepath+filename);
              int i;          
              while ((i=fileInputStream.read()) != -1) {
                      out.write(i);
              fileInputStream.close();
              out.close();     

    I tried this but it doesn't work. In the report column it shows up as Download" >_ .
    This seems to indicate that the href code is not being interpreted correctly.
    Following is exactly what I have in the URL field:
    <a href="#OWNER#.DOWNLOAD_MY_FILE?p_file=#NOTIFICATION_SEQ_ID#&v_type=SUMMARY">Download</a>Yes, I have granted execute rights to the procedure.
    Thanks,
    Dale

  • Content-Disposition in IE

    Hi
    I want to stream a pdf file and then show in the browser . res.setHeader("Content-Disposition", "inline;filename=temp.pdf;");
    This works with netscape but in IE it shows blank page after starting a Acrobat process.
    But if i use
    res.setHeader("Content-Disposition", "attachment;filename=temp.pdf;"); this works with IE and netscape both . I am not able to figureout what is the problem . Anyone knows solution for this problem ? Please let me know .
    Thanks in advance
    Amit Kumar

    Hi
    I want to stream a pdf file and then show in the
    he browser . res.setHeader("Content-Disposition",
    "inline;filename=temp.pdf;");
    Hi,
    I am currently working with reports being exported to excel
    You can try this :
    res.setContentType("application/pdf");
    I think it should work ....but I am not sure whether the mime type for pdf is ("application/pdf"); or ("application/vnd-pdf");
    try both ....let me noe if fit works ....:)
    cheers

  • Content-disposition header - office 2007 warning

    When I set the response header in the following way- using content-disposition inline- and try to open a xls file, I don't get the open/save dialog due to content-disposition but a warning message comes from office 2007 saying "The file you're trying to open is in a different format..."
    response.setHeader{"content-disposition","inline;filename="+filename}Whereas, for the response header set in this way- using content-disposition attachment- the open/save dialog appears without being followed by a warning from office 2007.
    response.setHeader{"content-disposition","attachment;filename="+filename}Is there anyway I can avoid open/save dialog due to content-disposition and still not get the warning from office 2007?
    Edited by: 1normalguy on Nov 18, 2008 10:54 PM

    The problem is that "xls" is a different format. Office 2007 uses xlsx because the format (for all Office documents) has been completely altered in Office 2007. They are no longer even close to being the same thing, anymore.
    Edit: Gods! So many typos in so small a text!

  • 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

  • PDF content disposition on IE

    Hi,
    I am having difficulties in displaying PDF content from JSP. Obviously URL ends with mypdffile.jsp. From the JSP, I set attributes as follows. It works as intended on Firefox. Not on IE;
    response.setContentType("application/pdf;charset=UTF-8");
    response.setHeader("Content-Disposition", "inline;filename=\"Document.pdf\""); Any suggestions how I can fix this mess?

    On IE, it shows nothing! I can see that it reads something then nothing shows up. It is meant to display inside the viewing frame without creating external frames. If I change to "Content-disposition: attachment; filename=ddd.pdf", it comes out with PDF view frame. If you move the frame, you see lots of dirty traces on Windows frame!
    It may IE is not handling extension well.Or size information may be required.
    JSP is convenient to write changeable reports. PDF is generated using iText.
    Regards.

  • Download "Content-Disposition" to Excel

    I have a user who was having trouble getting an Excel file to download properly. When she clicked on the web link created by my procedure, her Excel file would download all the columns into one field. For myself, and most other users, it downloads normally with all the columns and fields where they should be. She was also missing the prompt asking if you wanted to open or save the file. It was just downloading to Excel right away.
    Now, the user said she did not have this problem with all her Excel downloads, just this one. So I looked at the program that had the Excel download that worked for her and compared it to the one that didn't.
    And there was a difference.
    The download that did NOT work for her had this line of code: htp.print('Content-Disposition: inline; filename='||v_file_name1);
    The download that DID work for her had this code: htp.print('Content-Disposition:attachment; filename='||v_file_name1);
    In the program that wasn't working for her I replaced the part of Content-Disposition with "attachment" instead of "inline". That seemed to do it. Nothing more needs to be done, but I dont' really know why it worked. I can't seem to find a definintion of what an "inline" Content-Disposition means vs. "attachment". Anyone know? Thanks!
    Oh, and here's the surrounding owa_util code in case that helps make it more clear where it was coming from:
    owa_util.MIME_HEADER('text/comma-delimited', FALSE);
    htp.print('Content-Disposition:attachment; filename='||v_file_name1);
    owa_util.HTTP_HEADER_CLOSE;
    Message was edited by:
    user527082

    I have a user who was having trouble getting an Excel file to download properly. When she clicked on the web link created by my procedure, her Excel file would download all the columns into one field. For myself, and most other users, it downloads normally with all the columns and fields where they should be. She was also missing the prompt asking if you wanted to open or save the file. It was just downloading to Excel right away.
    Now, the user said she did not have this problem with all her Excel downloads, just this one. So I looked at the program that had the Excel download that worked for her and compared it to the one that didn't.
    And there was a difference.
    The download that did NOT work for her had this line of code: htp.print('Content-Disposition: inline; filename='||v_file_name1);
    The download that DID work for her had this code: htp.print('Content-Disposition:attachment; filename='||v_file_name1);
    In the program that wasn't working for her I replaced the part of Content-Disposition with "attachment" instead of "inline". That seemed to do it. Nothing more needs to be done, but I dont' really know why it worked. I can't seem to find a definintion of what an "inline" Content-Disposition means vs. "attachment". Anyone know? Thanks!
    Oh, and here's the surrounding owa_util code in case that helps make it more clear where it was coming from:
    owa_util.MIME_HEADER('text/comma-delimited', FALSE);
    htp.print('Content-Disposition:attachment; filename='||v_file_name1);
    owa_util.HTTP_HEADER_CLOSE;
    Message was edited by:
    user527082

  • Specifying pdf document's name in browser - content-disposition problem

    Hello ,
    I want to open a PDF document in browser, which needs to have a specified filename when user tries to save it.
    My web app sends an "application/pdf" document back to the browser.
    I use the Content-Disposition HTTP header to instruct the browser to open the document inline, i.e. using the appropriate plugin, which is Adobe PDF in this case. When the user clicks Save As..., the document filename needs to be the one specified by the same HTTP header. Here is the code:
    response.setContentType("application/pdf");
    String contentDisposition = "inline; filename=\"filename.pdf\"";
    response.setHeader ("Content-Disposition", contentDisposition);
    response.setHeader ("Content-Length",new Long(file.length()).toString());Unfortunately this does not work for me. Document opens fine, but I can't get it to have the name I specified. The plugin uses the default name, which is the full URL of the document. I tried several combinations of HTTP headers, but neither worked. I tried putting an additional GET request parameter at the end of the URL, like ...&filename=filename.pdf , but that didn't work either.
    I tried Adobe 7.0 and 8.1.2.
    Any suggestions ?
    Thanks a lot!

    Thank you very much for your answer.
    Needless to say I tried opening the document in IE, FF and Chrome, and neither worked.
    I had a look at the code at your web site, and saw that you were serving files for direct download: Content-Dispositoin:attachment... .
    This works fine for me too, and the filename is recognized correctly in that case. The problem is, I want to display the PDF inline...
    My server is not configured for URL rewriting, and I would be probably quite some problem to make this app work with it, so the /filename.pdf is not an option for me.
    Edited by: matavulj on Sep 25, 2008 7:21 AM

  • Setting the title for File download dialog when using content-disposition

    I am trying to send a file from server to client (browser). I am setting the content type of the resopnse and using the "content-disposition" header and giving the filename.
    But the issue is, when it is downloading and the dialog box is showing the progress bar, The title of the dialog box is showing something like "40% of localhost:9080.....". It doesn't show the file name in the title bar. Also, if the URL is very long (I am passing some get parameters and the servlet name is also long), I get junk characters like small boxes.
    How to set this title in the servlet?

    Is there a reason why you have to use FileReference.Save versus File.browseForSave?  In Adobe AIR, the File class, which extends the FileReference class,    provides more capabilities and has less security restrictions than the FileReference class.  Using File.browseForSave, it has a title:String parameter which is a string that is diplayed in the title bar of the dialog box.

  • Setting path for "Content-disposition" filename

    I'm trying to figure out how to set the filename in the following:
    String path = "/usr/local/jakarta-tomcat-4.1.29/webapps/myapp/my_images.zip";
    response.setContentType("application/octet-stream");
    response.setHeader("Content-disposition","attachment; filename=" +path);The file that I'd like the user to download is called my_images.zip. It resides here: /usr/local/jakarta-tomcat-4.1.29/webapps/myapp/my_images.zip
    However, when I run the servlet, it pops up a dialog box with this as the filename: usrlocal_jakarta-tomcat-4.1.29_webapps_myapp_my_images.zip
    It's replaced the slashes with underscores. What's going on? The zip file resides in the root folder of my app. The servlet is in a subfolder called "fpauto".

    Ah, ok. Right, so when you set that heading what you are saying to the client is: "The response from this web request is actually a file with the following name..."
    For example you could set it to be README.TXT and then use
    response.getWriter().println("Hello World.");as the only other line of your servlet. That would send a text "file" called README.TXT to the client containing the text "Hello World" only. Setting that response header doesn't tell the servlet to do anything other than inform the client what filename to use.
    It would be nice if there was a method called "transmit file" or somesuch, but there isn't. The simplest reason why is that if you just want to send a file you can usually provide it directly from the web (or app) server by putting it into the content. For example create a file my_files.zip in the root of your war and it will typically be made available as a file anyway.
    The assumption is that servlets are for generating content not just sending content that already exists.
    However, if you have a good reason for wanting to do this, you can create a loop that reads in the file and sends its contents to the response's output stream. I usually use the commons-io IOUtil [copy |http://commons.apache.org/io/api-1.4/org/apache/commons/io/IOUtils.html#copy(java.io.InputStream,%20java.io.OutputStream)] functions to do this.
    So why do you want to use a servlet to send "static" content?

Maybe you are looking for