I am new to apache camel. I am trying to upload txt file from HTML page but not getting file in correct form at receiver end. I am getting below mentioned data in exchange body, getting webform boundary along with the content of the file.
------WebKitFormBoundaryOAiLMJtrA2g4CB32
Content-Disposition: form-data; name="test.txt"
Hello how are you..?
------WebKitFormBoundaryOAiLMJtrA2g4CB32
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
------WebKitFormBoundaryOAiLMJtrA2g4CB32--
I am using rest end point of apache camel.
HTML Page:
<form method="post" action="uploadFile" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="Upload" />
</form>
Apache Rest Endpoint:
rest("/uploadFile").post("/")
.param("file").endParam()
.to("bean:BeanName?method=converterMethod(Exchange)");
How could I extract the file content from this?
I need to extract only content like -> Hello how are you..?