tBoxPut
Uploads files to a Box account.
This component uploads data to Box from either a local file or a given data
flow.
tBoxPut Standard properties
These properties are used to configure tBoxPut running in the Standard Job framework.
The Standard
tBoxPut component belongs to the Cloud family.
The component in this framework is available in all Talend
products.
Basic settings
Use existing connection |
Select this check box and in the Component List click the relevant connection component to |
Connection/Client Key |
Enter the client key required by Box to access the Box API. To obtain the client key and |
Connection/Client Secret |
Enter the client secret required by Box to access the Box API. To obtain the client key and |
Connection/Access Token |
Enter the access token required by Box to access a Box account and operate it. For how to get |
Connection/Refresh Token |
Enter the refresh token required by Box to refresh the access token automatically. For how to |
Connection/Use HTTP proxy |
If you are using a proxy, select this check box and enter the host and port information of |
Remote Path |
Enter the path pointing to the file you need to write contents in. This file will be |
Replace if Existing |
Select this check box to use the uploaded file to replace the |
Upload mode |
Select the upload mode to be used:
|
Schema and Edit schema |
A schema is a row description. It defines the number of fields Note that the schema of this component is read-only with a single The Schema field is not available when you have |
Advanced settings
tStatCatcher Statistics |
Select this check box to collect log data at the component |
Global Variables
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component is used either standalone in a subJob to directly upload a local file to |
Uploading and downloading files from Box
In this scenario, a three-component Job consisting of three subJobs is created
to upload a file to Box and then download a file from Box to the local file system.
Before replicating this scenario, you need to create an account at https://developers.box.com/ and then create a Box App under the Box account to be
used. For more information about Box App, see https://app.box.com/developers/services/edit/. The client key and
client secret can be obtained from the account application settings. For how to get the access
token and refresh token, check the Box documentation you can access from https://developers.box.com/.
Linking the components
-
In the
Integration
perspective of the Studio, create
an empty Job from the Job Designs node in
the Repository tree view.For further information about how to create a Job, see
Talend Studio User Guide. -
In the workspace, enter the name of the component to be used and select this component
from the list that opens. In this scenario, the components are tBoxConnection, tBoxPut and tBoxGet. -
Connect tBoxConnection to tBoxPut using the Trigger >
OnSubjobOk link. -
Connect tBoxPut to tBoxGet
using the Trigger > OnSubjobOk link.
Configuring the components
-
Double-click tBoxConnection to open its Component view.
-
Enter the client key, client secret, access token and refresh token in double quotation
marks in the relevant fields for accessing the Box account. -
Double-click tBoxPut to open its
Component view. -
Select the Use Existing Connection check box to reuse
the connection created by tBoxConnection.In the Remote Path field, enter the
destination path where you want to upload the file.In the Upload mode area, select Upload Local File. In the File field, enter the file path or browse to the file you
want to upload. -
Double-click tBoxGet to open its
Component view. -
Select the Use Existing Connection check
box to reuse the connection created by tBoxConnection.In the Path field, enter the path of the
file that you want to download.Select the Save As File check box. In the
Save To field, enter the file path
where to save the file on the local file system. - Save the Job.
Executing the Job
Execute the Job by pressing F6 or clicking the Run button on the Run
tab.
The local file, hello.txt in this example, is uploaded in your
Box.
The file box.txt from Box is downloaded to the local file
system.