Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

API to get picture and load into a SGBD

Hello everyone, I have a question. I have to get every students' picture from a API, and then store the picture data and student's id in the Oracle database.

I have already tried tRestClient to get the photo and used a tJavaRow to load the photo in my desktop, even though the photo is inaccessible and not correct.

I want to know how can I save the photo into a database.

Is there anyone has an idea?

I appreciate so much for your help.

Best regards,

zzhou

Labels (4)
10 Replies
Anonymous
Not applicable

Can you actually download the picture when you try? When you say that it is inaccessible and not correct, does that mean that it is not downloading correctly? We will need a bit more detail about the API you are using in order to help with this.

Not applicable
Author

Thanks for your reply. Actually in the API when I enter the student code, formation code, it will show me a button Download file where I can download the image as png and open it.

0695b00000G4mwoAAB.jpgThen in Talend, I use tRestClient to retrieve the image which require an Bearer/token authentication ( that's why I can't use tFileFetch instead), then it tJavaRow I try to save the image into a file.

0695b00000G4mxFAAR.jpgwhen I execute the job, in my desktop there is a photo.jpg document, but when I click, il said "It looks like we don't support this file format". So it isn't correct for me.

 

My job is to retrieve the image from API and then save it in Oracle database with the format Blob.

 

Do you know how to achieve that?

 

Jmiles1658991691
Contributor III
Contributor III

Hi @ziyan zhou​ is your issue was resolved?

Not applicable
Author

Hello, Yes it’s resolved.
Jmiles1658991691
Contributor III
Contributor III

@ziyan zhou​ could you please share your screenshots. I have same scenario , tried with different method but not able to download

 

Thanks,

Jmiles1658991691
Contributor III
Contributor III

@ziyan zhou​ I have tried with tFileFatch & able to download image but when I'm trying to open it then it showing me error

Error:- It appears that we don't support this file format

Not applicable
Author

Sorry, I have quit the company for a while so I don’t have tool anymore.
Jmiles1658991691
Contributor III
Contributor III

@ziyan zhou​ Ok thanks for reply!!

do you have any idea how you had resolved?

Not applicable
Author

I have used tfilefetch then tJava component to encode or decode the picture (base 64 or binary) before downloading it in local. But I don’t remember the code I used. Maybe you can search some code to change the format of your picture.