<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: upload blob/byte[] in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313643#M644</link>
    <description>&lt;P&gt;Do you have any examples using this getByteArray() ???? and could you share it for me?&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2017 19:14:23 GMT</pubDate>
    <dc:creator>Ana_Paula_Lopes</dc:creator>
    <dc:date>2017-03-28T19:14:23Z</dc:date>
    <item>
      <title>upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313637#M638</link>
      <description>&lt;P&gt;Hello everyone,
Is it possible to upload a file by just blob or byte [] instead of the file itself ???
See the example below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;private Document exportNuxeo() throws IOException {
		
		
		Document doc = new Document("file", "File");
		doc.set("dc:title", "Documento 1");

		doc = nuxeoClient.repository().createDocumentByPath("/camara.leg/workspaces/", doc);

		Document docCriado = nuxeoClient.repository().fetchDocumentByPath("/camara.leg/workspaces/file");

		Blob fileBlob = new Blob(new File("c:\\Desenvolvimento\\doc-nuxeo\\teste.pdf"));

		nuxeoClient.automation().newRequest("Blob.AttachOnDocument").param("document", docCriado).input(fileBlob)
				.execute();

		return doc;
	}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;Blob fileBlob = new Blob(new File("c:\\Desenvolvimento\\doc-nuxeo\\teste.pdf"));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Instead of being the File object being, I use a Blob or byte []&lt;/P&gt;
&lt;P&gt;Because I will need to migrate multiple files from the sql server database to nuxeo....&lt;/P&gt;
&lt;P&gt;att
Ana Paula Lopes Araújo&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 19:09:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313637#M638</guid>
      <dc:creator>Ana_Paula_Lopes</dc:creator>
      <dc:date>2017-03-24T19:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313638#M639</link>
      <description>&lt;P&gt;someone???&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 14:04:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313638#M639</guid>
      <dc:creator>Ana_Paula_Lopes</dc:creator>
      <dc:date>2017-03-28T14:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313639#M640</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This is currently not possible with our java client. I created &lt;A href="https://jira.nuxeo.com/browse/JAVACLIENT-125" target="test_blank"&gt;https://jira.nuxeo.com/browse/JAVACLIENT-125&lt;/A&gt; to add this feature to client.
But it may take times to be done. You can create a PR with the feature if you want, have a look at &lt;A href="https://doc.nuxeo.com/nxdoc/contributing-to-nuxeo/" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/contributing-to-nuxeo/&lt;/A&gt; before.&lt;/P&gt;
&lt;P&gt;Unless, I'm afraid you need to serialize the byte[] to a file in order to upload it. Something like this should work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;FileUtils.writeByteArrayToFile(new File("pathname"), myByteArray)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;FileUtils is a class from Apache Common IO, used by the client.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 14:59:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313639#M640</guid>
      <dc:creator>Kevin_Leturc</dc:creator>
      <dc:date>2017-03-28T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313640#M641</link>
      <description>&lt;P&gt;I need to migrate some files (+/- one million and a half) that are in SQL Server to nuxeo ...&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:50:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313640#M641</guid>
      <dc:creator>Ana_Paula_Lopes</dc:creator>
      <dc:date>2017-03-28T15:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313641#M642</link>
      <description>&lt;P&gt;I would have these files in blob or byte []&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:51:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313641#M642</guid>
      <dc:creator>Ana_Paula_Lopes</dc:creator>
      <dc:date>2017-03-28T15:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313642#M643</link>
      <description>&lt;P&gt;The only way to do this is to write the blob or byte[] to a temporary file and then upload this file by using blob object from nuxeo-java-client.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:26:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313642#M643</guid>
      <dc:creator>Kevin_Leturc</dc:creator>
      <dc:date>2017-03-28T18:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313643#M644</link>
      <description>&lt;P&gt;Do you have any examples using this getByteArray() ???? and could you share it for me?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:14:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313643#M644</guid>
      <dc:creator>Ana_Paula_Lopes</dc:creator>
      <dc:date>2017-03-28T19:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: upload blob/byte[]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313644#M645</link>
      <description>&lt;P&gt;This isn't nuxeo-related, it's just pure java code. Something like this should work&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:02:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/upload-blob-byte/m-p/313644#M645</guid>
      <dc:creator>Kevin_Leturc</dc:creator>
      <dc:date>2017-03-29T17:02:22Z</dc:date>
    </item>
  </channel>
</rss>

