
-38-
v4.9
FTP and FTPS
7.3.3. Uploading files from 3G/GPRS module
To upload a file from the SD card of the 3G/GPRS module you can use the function
uploadFileSecure(3G_folder, FTPS_
destination_path)
.
3G_folder
is a number that indicates the folder that contains the file to upload. Allowed values for
3G_folder
:
•
0 – current directory
•
1 – “C:/Picture” directory
•
2 – “C:/Video” directory
•
3 – “C:/VideoCall” directory
•
4 – “D:/Picture” directory
•
5 – “D:/Video” directory
•
6 – “D:/VideoCall” directory
•
7 – “C:/Audio” directory
•
8 – “D:/Audio” directory
FTPS_desitanion
is a string that contains the complete path with the file name. The string must be start with the character ‘/’,
for example “/filename” or “/directory/filename”.
Example of use:
{
// Uploading a file from Video directory in the 3G microSD card
_3G. uploadFileSecure(5, “/FTPS_path/FTPS_file_name”);
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with CME code (FTP error)
•
‘-3’ if error getting the file of the size to upload
7.3.4. Downloading files to Waspmote
To download a file to Waspmote’s SD card you can use the function
downloadDataSecure(FTPS_origin, SD_destination)
.
FTPS_origin
and
SD_desitanion
are strings that contains the complete path with the file name. The strings must be start
with the character ‘/’, for example “/filename” or “/directory/filename”.
Example of use:
{
// Downloading a file from Waspmote
_3G.downloadDataSecure(“/FTPS_path/FTPS_file_name”, “/FTPS_path/FTPS_file_name”);
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with CME code (FTP error)
•
‘-3’ if error sending the file from 3G/GPRS module to Waspmote SD