• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » uploading a flat file over http

#1 2009-09-23 21:35:18

Paul-
New member
Registered: 2009-09-23
Posts: 4

uploading a flat file over http

Tags: [excel, file, upload]

This seems to be a common task, but I am new to Talend and can't figure it out.

I would like to set up a web page that allows a user to upload an Excel file. On the server side the information is read from the file and inserted into a database table.

I have learned how to create and export a job in TOS, which will read an Excel file from a directory and send the data to a database table. I also know how to set up a web page to upload a file. But how do I connect the two pieces? What is the best way to use the uploaded file as input to a Talend job?

Thanks.

Offline

#2 2009-09-24 05:31:20

shong
Talend team
Registered: 2007-08-29
Posts: 10294
Website

Re: uploading a flat file over http

Hello guy
In the job, Using a tFileFetch or tFTPGet component to get the file and put it to a directory first. and then using a tFileInputExcel to read this file and insert data into db.

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2009-09-24 16:11:41

Paul-
New member
Registered: 2009-09-23
Posts: 4

Re: uploading a flat file over http

shong wrote:

In the job, Using a tFileFetch or tFTPGet component to get the file and put it to a directory first. and then using a tFileInputExcel to read this file and insert data into db.

This still does not resolve the problem of calling the Talend job when the file upload is complete. One way I can think about it is as follows: Suppose the file is uploaded by a java servlet. The servlet could then call the Talend job as a web service, passing it the file path as a parameter. The Talend job could have a tFileInputExcel component which uses the passed in file path. Is this a reasonable solution? Is there an example or tutorial somewhere that explains how this is done?

Last edited by Paul- (2009-09-24 16:12:03)

Offline

#4 2009-09-29 20:18:54

Thomas Cook
Member
Registered: 2008-07-11
Posts: 238
Website

Re: uploading a flat file over http

There are several ways to invoke the exported Talend job.  Either way you choose, you would most likely set the filename up as a context variable, or use a tFileList to process all the files in a given directory.

- invoke it as a standalone java executable with the provided shell or batch scripts.  This would allow you call it from a java system() call
- invoke the jobs main() method from some java code
- invoke it as a web service as you described above see: http://www.talendforge.org/wiki/doku.ph … webservice

hope this helps,

Thomas

Offline

#5 2009-09-29 20:33:53

Paul-
New member
Registered: 2009-09-23
Posts: 4

Re: uploading a flat file over http

Thomas Cook wrote:

There are several ways to invoke the exported Talend job.  Either way you choose, you would most likely set the filename up as a context variable, or use a tFileList to process all the files in a given directory.

- invoke it as a standalone java executable with the provided shell or batch scripts.  This would allow you call it from a java system() call
- invoke the jobs main() method from some java code
- invoke it as a web service as you described above see: http://www.talendforge.org/wiki/doku.php?id=doc:export_as_webservice

Thanks, I think options 1 or 2 should work for me.

Regards,
Paul

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » uploading a flat file over http

Board footer

Powered by FluxBB