# Json pdf to oracle blob

**URL:** <https://forum.novacura.com/t/json-pdf-to-oracle-blob/509>\
**Category:** Flow Classic\
**Tags:** studio-or-server\
**Created:** [October 5, 2023, 6:54pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509 "2023-10-05T18:54:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [October 5, 2023, 6:54pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/1 "2023-10-05T18:54:26Z")

</div>

Hi all,

I’m having an issue getting a pdf from an URL and inserting it into an Oracle database. I’m using REST and connecting and receiving the JSON. I can see the path where the pdf is located(S3.amazon). How do I get this document using NovaCura?

–Tim

---

<div class="post-metadata">

**Author:** ![Shyaminda](https://avatars.discourse-cdn.com/v4/letter/s/7C9FD7/32.png) [@Shyaminda](https://forum.novacura.com/u/Shyaminda)\
**Post date:** [October 6, 2023, 3:39am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/2 "2023-10-06T03:39:47Z")

</div>

Hi,

You will have to confirgure a REST connector in novacura in order to retrive the PDF from the 3 rd party application . please refer the link below.

how to set up a REST connector - [Getting started - Flow Help (novacuraflow.com)](https://help.novacuraflow.com/connectors/areas/communication/rest-service/rest-project-tool/getting-started)

shyaminda

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [October 6, 2023, 4:27pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/3 "2023-10-06T16:27:36Z")

</div>

We have the REST connector setup and working. We have a URL to a PDF file on the internet. How can we get that file into Novacura to do things with it, like save it to a file system, or write a BLOB to the database?

---

<div class="post-metadata">

**Author:** ![tkohhh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/tkohhh/32/242_2.png) [@tkohhh](https://forum.novacura.com/u/tkohhh)\
**Post date:** [October 6, 2023, 8:04pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/4 "2023-10-06T20:04:59Z")

</div>

Coworker of @Keyhole here…

We know that Novacura can work with BLOBs, because that seems to be what’s created by the HTML2PDF connector. So maybe the most pertinent question is this:

Within Novacura, how can we convert RAW file data (i.e. the data returned by a GET) into a BLOB?

Tom

---

<div class="post-metadata">

**Author:** ![OlaCarlander](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/olacarlander/32/205_2.png) [@OlaCarlander](https://forum.novacura.com/u/OlaCarlander)\
**Post date:** [October 9, 2023, 9:38am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/5 "2023-10-09T09:38:09Z")

</div>

Hi,  
I do not have a working example against Oracle, but in MS SQL I think you would need to convert it to a binary. Convert(varminary(max), _your invariable_)

I thought the file connector would be just “write all bytes to file” or “write stream to file” option under the file connector.

Or perhaps I misunderstood, is the question around how you would fetch the binary from the Rest connector?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/696a5e539eb90b3228cafd949aeae358b64a9175.png)

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [October 9, 2023, 11:52am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/6 "2023-10-09T11:52:43Z")

</div>

Hi,

i one of our previous PoCs we were generating and then fetching documents from an online shipping (REST) service and attaching them to IFS (storing them as oracle blobs) via Flow.

In our case, the online documentation for that REST service told us that the document itself will come as a (Base64) string. So we were taking that data and just assigning it to a blob type variable and then using it in a procedure call.

 ![grafik](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/116fb607110fd7120f0b179459042540248fbf38.png)  
 ![grafik](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/3ca911524d24fabe79260340ec492392cb1337d0.png)

Also when using HtmlToPdf connector the result is a record with data column (that is a binary stream)  
We use the same procedure for attaching to IFS by just assigning that column to a blob variable and then using it in a procedure call.

 ![grafik](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/81461a122dfbcde6622217417927b0c2083e7bd3.png)

So i would say that the blob data type, when used within a machine step, is quite… accepting when it comes to contents and that no conversion is needed most of the time 🙂

Hope this helps!

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![davidg](https://avatars.discourse-cdn.com/v4/letter/d/7C9FD7/32.png) [@davidg](https://forum.novacura.com/u/davidg)\
**Post date:** [November 15, 2023, 8:26am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/7 "2023-11-15T08:26:20Z")

</div>

Hi!

Very curious in how you achieved this conversion from a base64 string to a binary blob.  
I have tried this in different ways but have not been able to get it to work…

How do you perform the conversion from base64 to binary?

Best Regards  
David

---

<div class="post-metadata">

**Author:** ![Alluse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/alluse/32/1013_2.png) [@Alluse](https://forum.novacura.com/u/Alluse)\
**Post date:** [November 22, 2023, 9:08am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/8 "2023-11-22T09:08:44Z")

</div>

Hi @davidg ,

As far as I know there’s no support in Flow to decode Base64 into binary, only to text. We’ve done decode to binary in projects by using a custom connector. In one customer solution we use Flow as an API for different integration scenarios, one being upload file to IFS. That API method takes a WoNo and Bas64 binary string as a parameters and check in the document to IFS DocMan and connects it to a work order.

Developing custom connectors will require some .NET knowledge. Here’s the help section on custom connectors: [Custom .NET - Flow Help](https://help.novacuraflow.com/connectors/areas/utility/custom-.net).

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 4, 2024, 8:43pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/9 "2024-03-04T20:43:41Z")

</div>

Hi, ivstde.

I’ve been trying for awhile now to get this .pdf into IFS and I’m not having any luck. Here’s the error that I am receiving.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/9a014205bff8fde21d101f619b9261ba5224d54f.png)

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 4, 2024, 8:48pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/10 "2024-03-04T20:48:00Z")

</div>

I’m trying to get the URL for the JSON:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/89611b6928a0b84d47321754eecbbc9e50fc6a80.png)

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 4, 2024, 8:48pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/11 "2024-03-04T20:48:30Z")

</div>

This is the string from PostMan:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/618b3d5359d8f92e8dbbf2cbd4f44a5703dd036a.png)

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 4, 2024, 8:49pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/12 "2024-03-04T20:49:01Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/e59e176febb0d766e5a19c844c9576cc0cc9f4ca.png)

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 4, 2024, 8:49pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/13 "2024-03-04T20:49:43Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/9d55216cfa9af2637e76edea3cf8dba8568cbe17.png)

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 4, 2024, 8:50pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/14 "2024-03-04T20:50:24Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/f7de7c992c60c7c9445fffab3062f4fb0c5d6f79.png)

---

<div class="post-metadata">

**Author:** ![Alluse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/alluse/32/1013_2.png) [@Alluse](https://forum.novacura.com/u/Alluse)\
**Post date:** [March 5, 2024, 7:17am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/15 "2024-03-05T07:17:02Z")

</div>

Seams like you are referencing the URL string in your PL SQL block. IFS is expecting a binary. You need to do a second call to fetch the binary data from that URL before using it in your script.

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [March 5, 2024, 1:38pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/16 "2024-03-05T13:38:32Z")

</div>

Hi @Keyhole ,  
its like Albin said, your rest call gets you a URL to file (a regular string) so you would first need to get the binary behind that URL and then assign it to blob variable to save in IFS.  
(In our case above we were getting a base64 string)

Its been a while but i seem to remember getting files from urls using PL/SQL (if you are the db admin because it includes setting up ACL and certificate wallet)

I did something similar to this:

> <https://stackoverflow.com/questions/33706770/procedure-to-download-file-from-a-given-url-in-oracle-11g-and-save-it-into-the-b>

And had to set up something similar to this:

> **[How to add THIS web-service to the ACL?](https://forums.oracle.com/ords/r/apexds/community/q?question=how-to-add-this-web-service-to-the-acl-9305)**
>
> I want to access a web-service from a PL/SQL procedure (using UTL\_HTTP) from a 11g R2 db. However, before doing anything, I need to give access to the web-service by adding the web-service to the acce...

> **[Application Express and HTTPS: Never see "Certificate Validation Error" again](https://apex.oracle.com/pls/apex/germancommunities/apexcommunity/tipp/6121/index-en.html)**
>
> This page describes why an ORA-29273 (Certificate Validation Error) happens and what to do in these cases.

I remember i wasn’t happy (with how complex the process was) when i did it 🙂

Not sure if there is an easier way of getting the file behind the URL

Hope this helps

B R  
Ivan

---

<div class="post-metadata">

**Author:** ![Alluse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/alluse/32/1013_2.png) [@Alluse](https://forum.novacura.com/u/Alluse)\
**Post date:** [March 5, 2024, 1:52pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/17 "2024-03-05T13:52:05Z")

</div>

Yeah, why not use the Novacura Rest connector? 🙂

Otherwise it could be done via Oracle, but that’s more complicated indeed.

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 5, 2024, 6:22pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/18 "2024-03-05T18:22:34Z")

</div>

I am using REST.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/3debdb5ba00833b9ae6a3b8cc6da593bc0d72737.png)

---

<div class="post-metadata">

**Author:** ![Keyhole](https://avatars.discourse-cdn.com/v4/letter/k/7C9FD7/32.png) [@Keyhole](https://forum.novacura.com/u/Keyhole)\
**Post date:** [March 5, 2024, 6:23pm UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/19 "2024-03-05T18:23:36Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/1fe263406814fc3c9d34fc83bcc5d8d304fcd2ec.png)

---

<div class="post-metadata">

**Author:** ![Alluse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/alluse/32/1013_2.png) [@Alluse](https://forum.novacura.com/u/Alluse)\
**Post date:** [March 6, 2024, 10:50am UTC](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509/20 "2024-03-06T10:50:25Z")

</div>

Good. Setup a subsequent GET call using that URL with a binary response. This can then be used in your PL SQL script.

> **[Custom model member](https://help.novacuraflow.com/connectors/areas/communication/rest-service/rest-project-tool/models/custom-model-member)**

[Next page](https://forum.novacura.com/t/json-pdf-to-oracle-blob/509.md?page=2)
