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.


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.

Eight Stars

Re: Host static files

Super. This is awesome. Thanks!

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.