Skip to main content
To test or verify FTP server functions, a test application isn’t required. Perform FTP functions through the client connection.

Prerequisites

Before you begin, set up the device as described in Set up the device for Bluetooth FTP functions.

Create a folder

To create a folder on the remote device, run the following command from the obexctl menu:
mkdir <folder_name>
You can verify folder creation on the server at the /var/bluetooth directory. Parameters <folder_name> is the new folder name. Example To create a folder called new_dir, run the following command:
mkdir new_dir
Sample output
#mkdir new_dir
Attempting to CreateFolder
CreateFolder successful

Change the current folder

To change the current folder of the remote device, run the following command from the obexctl menu:
cd <folder_path>
Parameters <folder_path> is the folder that you intend to switch to. Example To change the current folder to new_dir, run the following command:
cd new_dir
Sample output
#cd new_dir
Attempting to ChangeFolder to new_dir
ChangeFolder successful

Get current folder information

To get information about the current folder, run the following command from the obexctl menu:
ls .
Sample output
# ls .
Attempting to ListFolder
[NEW] Transfer /org/bluez/obex/client/session7/transfer4
[CHG] Transfer /org/bluez/obex/client/session7/transfer4 Size: 611
[CHG] Transfer /org/bluez/obex/client/session7/transfer4 Status: complete
      Type: folder
      Name: My_folder
      User-perm: RWD
      Group-perm: R
      Other-perm:
      Accessed: 20231214T123503Z
      Modified: 20231214T123502Z
      Created: 20231214T123502Z
      Type: folder
      Name: new_dir
      User-perm: RWD
      Group-perm: R
      Other-perm:
      Accessed: 20231215T093311Z
      Modified: 20231215T093245Z
      Created: 20231215T093245Z

Copy a file to a remote device

To copy a local file to the remote device, run the following command from the obexctl menu:
cp :<source_file> <destination_file>
Parameters
  • <source_file> is the local file.
  • <destination_file> is the target file on the remote device.
Example To copy a local file at Documents/ftp_client.txt to the ftp_client.txt on the remote device, run the following command:
cp :Documents/ftp_client.txt ftp_client.txt
Sample output
# cp :Documents/ftp_client.txt ftp_client.txt
Attempting to PutFile
[NEW] Transfer /org/bluez/obex/client/session7/transfer5
Transfer /org/bluez/obex/client/session7/transfer5
      Status: queued
      Name: ftp_client.txt
      Size: 10
      Filename: Documents/ftp_client.txt
      Session: /org/bluez/obex/client/session7
[CHG] Transfer /org/bluez/obex/client/session7/transfer5 Status: complete
[DEL] Transfer /org/bluez/obex/client/session7/transfer5

Copy a file from a remote device

Before you begin, change the current folder to the folder of the intended file. To copy a file from the remote device to a local directory, run the following command from the obexctl menu:
cp <destination_file> :<source_file>
Parameters
  • <source_file> is the file on the remote device.
  • <destination_file> is the target file on the local device.
Example To copy ftp_client_2.txt file from the remote device to the local device, run the following command:
cp ftp_client_2.txt :ftp_client_2.txt
Sample output
# cp ftp_client_2.txt :ftp_client_2.txt
Attempting to GetFile
[NEW] Transfer /org/bluez/obex/client/session7/transfer21
Transfer /org/bluez/obex/client/session7/transfer21
      Status: queued
      Name: ftp_client_2.txt
      Size: 0
      Filename: ftp_client_2.txt
      Session: /org/bluez/obex/client/session7
[CHG] Transfer /org/bluez/obex/client/session7/transfer21 Size: 13
[CHG] Transfer /org/bluez/obex/client/session7/transfer21 Status: complete
[DEL] Transfer /org/bluez/obex/client/session7/transfer21

Copy a file in a remote device

To copy a file from a directory to another directory on the remote device, run the following command from the obexctl menu:
cp <source_file> <destination_file>
Parameters
  • <source_file> is the file you intend to copy.
  • <destination_file> is the target location.
Example To copy ftp_client.txt to /new_dir_2/, run the following command:
cp ftp_client.txt ../new_dir_2/ftp_client.txt
Sample output
# cp ftp_client.txt ../new_dir_2/ftp_client.txt
Attempting to CopyFile
CopyFile successful

Move a file

To move a file from one folder to another on the remote device, run the following command from the obexctl menu:
mv <source_file> <destination_file>
Parameters
  • <source_file> is the file you intend to move.
  • <destination_file> is the target location.
Example To move ftp_client_2.txt file to /new_dir_2/, run the following command:
mv ftp_client_2.txt ../new_dir_2/ftp_client_2.txt
Sample output
#mv ftp_client_2.txt ../new_dir_2/ftp_client_2.txt
Attempting to MoveFile
MoveFile successful

Delete a file

To delete a file, run the following command from the obexctl menu:
rm <filename>
Parameters <filename> is the file you intend to delete. Example To delete ftp_client.txt file, run the following command:
rm ftp_client.txt
Sample output
# rm ftp_client.txt
Attempting to Delete
Delete successful