You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by torymitch <mi...@bah.com> on 2015/05/08 17:52:33 UTC

Tar file being manipulated when uploaded through camel restlet

I have created a camel REST endpoint which accepts a post request and passes
it along to be processed.  The endpoint expects a tar file to be uploaded
which it then moves to a folder where it will be picked up and processed.

My code looks like the following:

from("restlet:http://localhost:8090?restletMethods=post&restletURriPatterns=#uriTemplates")
.removeHeaders("*")
.setHeader(Exchange.FILE_NAME, constant("test.tar"))
.setHeader(Exchange.FILE_CONTENT_TYPE, constant("application/x-tar"))
.toF("file:///%s?noop=true", file_path)
.process(new Processor)

The application does consume the file, moves it to the file_path directory,
and passes on processing to the processor that I've specified, but it seems
to add a header to the incoming file prior to copying it to the directory.
The header resembles the following and it seems to modify the type of the
file being created:

---------------------------4316fb946f10
Content-disposion: form-data; name="file"; filename="test.tar" Content-Type:
application/octet-stream


Could you please let me know how to tell camel not to open the file and add
this information as a header to the file.  This is changing the format of
the file, and when it is trying to be untarred later on down the road, I am
running into processing issues.

If I vi the tar file that is moved to the new folder, I receive the
following message:

" tar.vim version v11
" Browsing tarfile ...............
" Select a file with cursor and press ENTER
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors


Any help is greatly appreciated




--
View this message in context: http://camel.465427.n5.nabble.com/Tar-file-being-manipulated-when-uploaded-through-camel-restlet-tp5766886.html
Sent from the Camel - Users mailing list archive at Nabble.com.