Host static files

Highlighted
Eight Stars

Host static files

Is it possible for me to use Talend Runtime container as a way to host "static" content like images/ html/ pdf? 


Accepted Solutions
Community Manager

Re: Host static files

Here is a very basic example that will allow you to do this. The layout of the job is shown in the screenshot below.

mini_blob_20150715-0953.png

The configuration of the tFileInputRaw is below....

mini_blob_20150715-0955.png

The tConvertType component converts the output from the tFileInputRaw from Object to byte[].

The tRestResponse is configured as below...

 

mini_blob_20150715-0956.png

On the Advanced Settings tab you need to set some Response Headers.....

mini_blob_20150715-0957.png

 

When you run the service and call it through a browser, it will return your file.

View solution in original post


All Replies
Community Manager

Re: Host static files

How do you mean "host"? Do you want them to be available via the Runtime in the same way they would be via a Web Server?

Eight Stars

Re: Host static files

@rhall_2_0. Yes, that is correct. I do not want to spin off a new web server instance just to host a couple of static files.
Community Manager

Re: Host static files

Here is a very basic example that will allow you to do this. The layout of the job is shown in the screenshot below.

mini_blob_20150715-0953.png

The configuration of the tFileInputRaw is below....

mini_blob_20150715-0955.png

The tConvertType component converts the output from the tFileInputRaw from Object to byte[].

The tRestResponse is configured as below...

 

mini_blob_20150715-0956.png

On the Advanced Settings tab you need to set some Response Headers.....

mini_blob_20150715-0957.png

 

When you run the service and call it through a browser, it will return your file.

View solution in original post

Eight Stars

Re: Host static files

Super. This is awesome. Thanks!

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read