<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>wrong name filname generated from serveResource</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=4381763" />
  <subtitle>wrong name filname generated from serveResource</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=4381763</id>
  <updated>2026-06-07T04:30:17Z</updated>
  <dc:date>2026-06-07T04:30:17Z</dc:date>
  <entry>
    <title>RE: wrong name filname generated from serveResource</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4382690" />
    <author>
      <name>Dariusz Sawicki</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4382690</id>
    <updated>2009-12-16T22:18:31Z</updated>
    <published>2009-12-16T22:18:31Z</published>
    <summary type="html">Thanks for replay.&lt;br /&gt;I made misteke (The post before  I pasted code from my tests )&lt;br /&gt;&lt;br /&gt;Exactly I have :&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;attachment; filename=all.pdf&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;But it&amp;#39;s wrong only in Firefox.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;&lt;br /&gt;Dariusz</summary>
    <dc:creator>Dariusz Sawicki</dc:creator>
    <dc:date>2009-12-16T22:18:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: wrong name filname generated from serveResource</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4382090" />
    <author>
      <name>Amos Fong</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4382090</id>
    <updated>2009-12-16T17:55:03Z</updated>
    <published>2009-12-16T17:55:03Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Dariusz,&lt;br&gt;&lt;br&gt;Not sure if this is the cause, but content disposition should be separated by semi-colon, not comma:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;attachment; filename=all.pdf&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;a href="http://www.ietf.org/rfc/rfc2183.txt"&gt;http://www.ietf.org/rfc/rfc2183.txt&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Amos Fong</dc:creator>
    <dc:date>2009-12-16T17:55:03Z</dc:date>
  </entry>
  <entry>
    <title>wrong name filname generated from serveResource</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4381762" />
    <author>
      <name>Dariusz Sawicki</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4381762</id>
    <updated>2009-12-16T15:48:18Z</updated>
    <published>2009-12-16T15:48:18Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi&lt;br&gt;I developed portlet which generate file. But everything works ok in ie and opera (I get filname "all.pdf")&lt;br&gt;But on firefox filename looks like this "all.pdf," (with extra comma)&lt;br&gt;&lt;br&gt;Why firefox add to filname extra ","? &lt;br&gt;&lt;br&gt;I have in my configuration.jsp this code :&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
 &amp;amp;lt;%
 LiferayPortletURL resourceURL = (LiferayPortletURL) renderResponse.createResourceURL();
 resourceURL.setPortletId(ParamUtil.getString(request, "portletResource"));
 resourceURL.setParameter("pdf_one", "true");
  
 %&amp;amp;gt;

&amp;lt;a href="&amp;lt;%= resourceURL.toString()%&amp;gt;" alt="Save to xls"&amp;gt;&amp;lt;/a&amp;gt;
    &amp;lt;input type="button" value="PDF" name="save_to_xls"&amp;gt;

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;And this in my class &lt;br&gt;&lt;br&gt;in serveResource I have&lt;br&gt;&lt;pre&gt;&lt;code&gt;
  res.setCharacterEncoding("UTF-8");
                res.setContentType("application/pdf");
                res.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");

                res.addProperty(HttpHeaders.CONTENT_DISPOSITION,"attachment, filename=all.pdf");
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks for help&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;&lt;br&gt;Dariusz&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Dariusz Sawicki</dc:creator>
    <dc:date>2009-12-16T15:48:18Z</dc:date>
  </entry>
</feed>
