Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I need to post a picture (.jpg file) using an api with Talend.
Thank you very much for your help.
Best regards
after few schearch , it seems tfilefetch can upload file , maybe it's a better solution than trestclient
But with tFileFetch we haven't the option to use a token.
In the advanced parameters i can see only authentification with user and password.
add it on the header : key: Authorization value: Bearer (your bear token)
you can see it on the postman header of your request
With the tRESTClient i deleted those who have the value calculated when request is sent. And now i have the error HTTP 302 found.
Ok i will try with the tFileFetch.
I tried with the tFileFetch but i have a 302 error.
check the checkbox : Supporter la redirection
I checked the box "Supporter la redirection"
The picture is not uploaded and i have this message :
Starting job PostPicture at 17:04 27/05/2021.
[statistics] connecting to socket on port 3730
[statistics] connected
mai 27, 2021 5:04:59 PM org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
AVERTISSEMENT: Cookie rejected: "$Version=0; .AspNetCore.Correlation.WsFederation.TJA834Kl8XKQzyAn0QTbmFdU17466oVHhAKXW0L0nTc=N; $Path=/signin-wsfed". Illegal path attribute "/signin-wsfed". Path of origin: "/sync/SetPictureUser"
mai 27, 2021 5:04:59 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFOS: Redirect requested but followRedirects is disabled
Redirect to: https://fed.plop.com/adfs/ls/?wtrealm=https%3A%2F%2Fpreprod-monprofil.plop.com&wa=wsignin1.0&wreply=https%3A%2F%2Fpreprod-monprofil.plop.com%2Fsignin-wsfed&wctx=CfDJ8Lk1mSvqXe1BhWaRY4j4lNrJQSydG_-17YRh2vqMQg_6bXUgHzgpzLCKxqUUZDmZMLJ-Th1IefDDJueqspumCx903pdj0iaa-AOeM_LBYIj3FLHgREDZEChkvnP-eswDmHgCwF2bJ6rSnXtNUf6rYnth_OIl8ztdk9KY3mbVPbjmCzZ7kprXaDGf4jEe3InDtUeFpbNR_IbBR8elI56H4BYz2G34QtxUNZ-4hcPXBPco9i18BHOCnO5MayOl2lJWRq0wttUeg-UIQqBfVqK3uSM
[statistics] disconnected
Job PostPicture ended at 17:04 27/05/2021. [exit code = 0]
I am always blocked on this topic.
I saw this post https://community.talend.com/s/question/0D53p00007vCqSWCA0/passing-multipart-form-data-in-talend
So i think it's possible with tRestClient.
I tried again and i have the message :
"Exception in component tRESTClient_3 (PostPicture)
javax.ws.rs.WebApplicationException: HTTP 302 Found
at prj_mch.postpicture_0_1.PostPicture.tRESTClient_3Process(PostPicture.java:1748)
at prj_mch.postpicture_0_1.PostPicture.runJobInTOS(PostPicture.java:5086)
at prj_mch.postpicture_0_1.PostPicture.main(PostPicture.java:4778)"
In fact i think i have 2 problems.
1) Problem of access (HTTP 302 found)
2) In the parameter "Image" of the API i put the path of the file but we need to put directly the file.
Someone can help me to find how to put a file in a parameter of an api with Talend ? and not just the path of the file. So for the point 2)
Thanks