How to add a file (pdf) to Liferay Portal using an OutputStreamHow to add a file (pdf) to Liferay Portal using an OutputStreamhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1212080512024-03-28T20:10:42Z2024-03-28T20:10:42ZRE: RE: How to add a file (pdf) to Liferay Portal using an OutputStreamMaria Zhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1212296172021-11-03T11:31:58Z2021-11-03T11:31:57Z<p>I don't know hahah. But I have fixed it creating an input file from
an output file. Thank you!!</p>Maria Z2021-11-03T11:31:57ZRE: How to add a file (pdf) to Liferay Portal using an OutputStreamOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1212168472021-10-25T08:03:41Z2021-10-25T08:02:26Z<p>I'm pretty sure I've answered this question very recently. Did you
crosspost it somewhere else? Or did I miss hitting the
"submit" button?</p>Olaf Kock2021-10-25T08:02:26ZHow to add a file (pdf) to Liferay Portal using an OutputStreamMaria Zhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1212080502021-10-20T16:51:32Z2021-10-20T11:24:24Z<p>Hi!</p>
<p>I would like to ask you if there is a way to upload a pdf to the
Document Library using an OutStream.</p>
<p>My code is the next one:</p>
<pre>
<code class="language-java">//I have a variable (String) which contains the html of the pdf document
OutputStream out = resourceResponse.getPortletOutputStream();
HtmlConverter.convertToPdf(html, out);
//Now I want to add the pdf which is stored in the otuput stream to a folder
DLAppServiceUtil.addFileEntry(idRepository, idFolder, "title.pdf", "application/pdf","title.pdf", StringPool.BLANK, StringPool.BLANK, ????, html.length, serviceContext);</code></pre>
<p>