Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: wrong name filname generated from serveResource
Hi
I developed portlet which generate file. But everything works ok in ie and opera (I get filname "all.pdf")
But on firefox filename looks like this "all.pdf," (with extra comma)
Why firefox add to filname extra ","?
I have in my configuration.jsp this code :
And this in my class
in serveResource I have
Thanks for help
Regards
Dariusz
I developed portlet which generate file. But everything works ok in ie and opera (I get filname "all.pdf")
But on firefox filename looks like this "all.pdf," (with extra comma)
Why firefox add to filname extra ","?
I have in my configuration.jsp this code :
<%
LiferayPortletURL resourceURL = (LiferayPortletURL) renderResponse.createResourceURL();
resourceURL.setPortletId(ParamUtil.getString(request, "portletResource"));
resourceURL.setParameter("pdf_one", "true");
%>
<a href="<%= resourceURL.toString()%>" alt="Save to xls"></a>
<input type="button" value="PDF" name="save_to_xls">
And this in my class
in serveResource I have
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");
Thanks for help
Regards
Dariusz
Hi Dariusz,
Not sure if this is the cause, but content disposition should be separated by semi-colon, not comma:
http://www.ietf.org/rfc/rfc2183.txt
Not sure if this is the cause, but content disposition should be separated by semi-colon, not comma:
attachment; filename=all.pdfhttp://www.ietf.org/rfc/rfc2183.txt
Thanks for replay.
I made misteke (The post before I pasted code from my tests )
Exactly I have :
But it's wrong only in Firefox.
Regards
Dariusz
I made misteke (The post before I pasted code from my tests )
Exactly I have :
attachment; filename=all.pdf
But it's wrong only in Firefox.
Regards
Dariusz
Community
Company
Feedback