You can use a command line Python script to send files and folders with FileSender. You’ll need:
- The command line tool
- Your API key.
- Configuration for the command line tool. This is optional; it is a custom file that includes the FileSender URL, your username, and your API key.
Prerequisites
To use the FileSender command line tool, you’ll need to have Python 3 or later installed on your device. Download the latest version from the Python site.
Download and set up the FileSender command line tool
-
Click
My Profile in the top navigation menu.
- Scroll down to Python CLI Client.
- Right click Download Python CLI Client and click Save Link As... or Download Linked File, depending on your browser.
- Create a folder on your device to keep the command line tool in.
- Go to your downloads folder, find the
filesender.py
file you downloaded earlier, and copy it to the new folder. -
If you want to use FileSender’s default client configuration – recommended so that you can avoid specifying every parameter in every command:
-
Create a subfolder called
.filesender
For Windows, create this in your user folder, typically found onC:/Users/[your local username]
For macOS or Linux, create this in your user folder, typically found on/Users/[your local username]
- Under Python CLI Client, right click Download Python CLI Client configuration and click Save Link As... or Download Linked File, depending on your browser.
- Go to your downloads folder, find the
filesender.py.ini
file downloaded, and copy it to the new.filesender
folder.
-
Create a subfolder called
Find your API key
Note: with the recent major update to FileSender, all API keys were purged from FileSender. This means that any previously created API keys will no longer work. To continue using the FileSender API, you will need to generate a new API key.
If you choose not to use the default client configuration file, you’ll need to retrieve and specify your API key explicitly in each command.
To retrieve your API key:
-
Click
My Profile in the top navigation menu.
- Copy the long string displayed under API secret.
If you have not previously created an API secret, clickNew API secret and accept the use policy for remote authentication.
If you want to delete your current API secret, clickClear API secret.
Send files from the command line
If you’re using the default configuration file, send files using this command:
python filesender.py -r [email] [files]
where
[email]
is the email address of the recipient.
[files]
is the locations and names of the files you’re sending, separated by a space.
If you’re not using the default configuration file, send files using this command:
python filesender.py -u [username] -a [API key] -r [email] [files]
where
[username]
is your FileSender username – typically your institute email address.
[API key]
is the API key you retrieved from FileSender earlier.
[email]
is the email address of the recipient.
[files]
is the locations and names of the files you’re sending, separated by a space.
You can also find information about optional command line parameters using the inbuilt help:
python filesender.py -h
Note: If you have multiple versions of Python on your device, you might need to run the filesender
command using a specific python3 command instead.