Best way to POST a file?

JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:578Unicorn
edited October 2019 inHelp

Hi guys,

I want to take the binary data file of an image and upload via POST multipart/form-data to a webservice, then consume the (JSON) result.

This should be possible with lots of writing in Groovy or Python, but is it possible in either the GetPage or EnrichData by WebService operators?

Answers

  • 艾丁_Klapic艾丁_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    嗨,约翰,

    I am not 100% sure if I get you correct but this should work with the File Upload functionality described inthisKnowledge base article. The upload functionality is not limited to MIME type Excel or CSV.

    You could also use curl. ForEnrich Data by Webservicethe image needs to be in the body of the message.

    Hope this helps.

    Best,

    艾丁

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager

    hi...I have tried to do something very similar with the Zamzar API where I am uploading a PDF binary. I use cURL instead of Enrich Data via Webservice as the latter did not work well for me. Here's my code - hopefully you will see what I was doing and adapt to your issue.





    <宏/ >




    @/Users/GenzerConsulting/Desktop/foo.pdf" -F "target_format=html5"https://sandbox.zamzar.com/v1/jobs"/>














    Scott

Sign InorRegisterto comment.