Place to Save Temp Files

One Star

Place to Save Temp Files

Hey guys, I'm working a project, which downloads a file from a FTP server using tFTPGet, rearranges the columns, then uploads the new file to another FTP server. I want to export the job as a .jar and make it portable to any machine. However, I'm running into a problem because I don't know where to store the files that get pulled from the FTP server. Is there a way to direct tFTPGet to save the files in some sort of local working directory? If not are there any other viable solutions to this problem? 
One Star

Re: Place to Save Temp Files

You can the files anywhere you want then delete them before your job finish.
One Star

Re: Place to Save Temp Files

I'm able to save the files and then delete them when I'm done. However, my problem is where do I save them if I want to make my job fully portable on each machine? Not every machine I'll be running it on will have a /usr/UserName/Desktop/ProjectTempFile folder. I'm wanting to know how to save it in the directory that the .jar file resides when I build the project. 

Re: Place to Save Temp Files

Can you use a context variable to define your temp data directory path? Such as, context.REX_DIR_TempFileCache.
Best regards
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Place to Save Temp Files

I can define a context variable to store the location path where I want to save the file. However, what I'm wanting to know is if there is a way to store the file in the same location that the built Job is running from. Once that job moves around, the directory path is not the same and I want to see if there is a dynamic way for the job to know where it is running from. 
Seventeen Stars

Re: Place to Save Temp Files

hi all,
I guess you misunderstood the use of context varaibles.
Have a look at how you can specify a context variable with different value due to the environement you're running it.


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Quality

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