Quectel GSM FTP AT Commands Manual V1.4
User Manual:
Open the PDF directly: View PDF .Page Count: 34
GSM
Quectel Cellular Engine
GSM FTP
AT Commands Manual
GSM_FTP_AT_Commands_Manual_V1.4
GSM FTP AT Commands Manual
Document Title
GSM FTP AT Commands Manual
Version
1.4
Date
2015-04-08
Status
Released
Document Control ID
GSM_FTP_AT_Commands_Manual_V1.4
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
General Notes
Quectel offers this information as a service to its customers, to support application and
engineering efforts that use the products designed by Quectel. The information provided is
based upon requirements specifically provided to Quectel by the customers. Quectel has not
undertaken any independent search for additional relevant information, including any
information that may be in the customer’s possession. Furthermore, system validation of this
product designed by Quectel within a larger electronic system remains the responsibility of
the customer or the customer’s system integrator. All specifications supplied herein are
subject to change.
Copyright
This document contains proprietary technical information which is the property of Quectel
Limited. The copying of this document and giving it to others and the using or
communication of the contents thereof, are forbidden without express authority. Offenders are
liable to the payment of damages. All rights are reserved in the event of grant of a patent or
the registration of a utility model or design. All specification supplied herein are subject to
change without notice at any time.
Copyright © Quectel Wireless Solutions Co., Ltd. 2015
GSM_FTP_AT_Commands_Manual_V1.4
-1-
GSM FTP AT Commands Manual
Contents
Contents ............................................................................................................................................ 2
0. Revision history ............................................................................................................................ 4
1. Introduction ................................................................................................................................... 5
1.1. Reference............................................................................................................................. 5
1.2. Terms and abbreviations ...................................................................................................... 5
2. AT Commands for FTP Service .................................................................................................... 6
2.1. Overview of AT Commands for FTP Service ..................................................................... 6
2.2. Detailed Description of AT Commands for FTP Service.................................................... 7
2.2.1. AT+QFTPOPEN Open an FTP service to the given FTP server ........................... 7
2.2.2. AT+QFTPCLOSE Close the FTP service .............................................................. 8
2.2.3. AT+QFTPPUT Upload a file to the FTP server ..................................................... 8
2.2.4. AT+QFTPGET Download a file from the FTP server ........................................... 9
2.2.5. AT+QFTPPATH Set the path in the FTP server to upload or download file ....... 10
2.2.6. AT+QFTPUSER Set the user name of the account to open FTP service ............. 11
2.2.7. AT+QFTPPASS Set the password of the account to open FTP service ............... 12
2.2.8. AT+QFTPCFG Set some configurable parameters for the FTP service .............. 12
2.2.9. AT+QFTPSTAT Query status of FTP service ...................................................... 14
2.2.10. AT+QFTPLEN Query the real size transferred in the latest transfer ................... 15
2.2.11. AT+QFTPRENAME Rename the file or file folder name on the ftp server ........ 15
2.2.12. AT+QFTPSIZE Query the size of appointed file on the ftp server ...................... 16
2.2.13. AT+QFTPDELETE Delete the appointed file on the ftp server .......................... 17
2.2.14. AT+QFTPMKDIR Establish a new file folder on the ftp server ......................... 17
2.2.15. AT+QFTPRMDIR Remove a file folder on the ftp server................................... 18
2.2.16. AT+QFTPLIST List contents of directory or file information on the ftp server.. 19
2.2.17. AT+QFTPNLST List file names in the given directory on the ftp server ............ 20
3. Summary of Error Codes ............................................................................................................ 21
4. Examples ..................................................................................................................................... 22
4.1. Open an FTP service ......................................................................................................... 22
4.2. Upload a file to FTP server ............................................................................................... 22
4.2.1. Upload a file through UART ............................................................................... 22
4.2.2. Upload a file in UFS ............................................................................................ 23
4.2.3. Upload a file in RAM .......................................................................................... 23
4.2.4. Upload a specified file in UFS ............................................................................. 24
4.3. Download a file from FTP server ...................................................................................... 25
4.3.1. Download a file through UART........................................................................... 25
4.3.2. Download a file into UFS .................................................................................... 25
4.3.3. Download a file into a specified file in UFS ........................................................ 26
4.3.4. Download a file into RAM .................................................................................. 26
4.4. Operate a file or a file folder on the FTP........................................................................... 27
4.4.1. Operate a file on the FTP server .......................................................................... 27
4.4.2. Operate a file folder on the FTP server ................................................................ 28
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
GSM_FTP_AT_Commands_Manual_V1.4
-2-
GSM FTP AT Commands Manual
4.5. Resume file at the resuming point ..................................................................................... 28
4.5.1. Upload a file to FTP server from the resuming point .......................................... 28
4.5.2. Download a file from FTP server from the resuming point ................................. 29
4.6. Get FTP list ....................................................................................................................... 30
4.7. Get FTP file name list ....................................................................................................... 31
4.8. Close the FTP service ........................................................................................................ 31
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
GSM_FTP_AT_Commands_Manual_V1.4
-3-
GSM FTP AT Commands Manual
0. Revision history
Revision
Date
Author
Description of change
1.00
2009-7-27
Colin HU
Initial
1.01
2010-4-12
Joanna LI
Added example for resuming file.
1.1
2010-7-1
Colin HU
Added the notice of hardware flow control when
transferring file.
2010-8-3
Colin HU
Added the description about how to upload a file
in UFS or SD or RAM and download a file to
UFS or SD or RAM.
2012-1-20
Derrick DAI
Added the description about the new AT
commands which control the operations of file
and file folder on FTP.
2012-6-4
Will SHAO
Modified AT+QFTPGET for RAM file.
2012-8-22
Jonathan WEN
Added AT+QFTPLIST & AT+QFTPNLST.
2012-8-24
Jonathan WEN
Added examples of downloading FTP file to
RAM and uploading RAM file to FTP.
2015-04-08
Jonathan WEN
Added applicable modules
1.2
1.3
1.4
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
GSM_FTP_AT_Commands_Manual_V1.4
-4-
GSM FTP AT Commands Manual
1. Introduction
Quectel Module provides an internal TCP/IP stack that is driven by AT commands and
enables the host application to easily access the Internet service. It includes TCP service,
UDP service, HTTP service and FTP service, etc. This document is a reference guide to all
the AT commands and responses defined for FTP Service.
This document is applicable to all Quectel GSM modules.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
1.1. Reference
Table 1: Reference
SN
Document name
Remark
[1]
M10_ATC.pdf
The introduction to AT commands for M10
[2]
GSM_TCPIP_AN.pdf
To introduce how to use the internal TCP/IP stack
[3]
GSM_File_ATC
To introduce the AT command for the file system
1.2. Terms and abbreviations
Table 2: Terms and abbreviations
Abbreviation
Description
APN
Access Point Network
CSD
FTP
GPRS
HTTP
TA
TCP
TE
UART
UDP
UFS
Circuit Switched Data
File Transfer Protocol
General Packet Radio Service
Hypertext Transfer Protocol Overview
Terminal Adapter, i.e. the module
Transmission Control Protocol
Terminal Equipment, i.e. the device who control the module via UART
Universal Asynchronous Receiver/Transmitter
User Datagram Protocol
User File Storage. Please refer to [3]
GSM_FTP_AT_Commands_Manual_V1.4
-5-
GSM FTP AT Commands Manual
2. AT Commands for FTP Service
2.1. Overview of AT Commands for FTP Service
Command
Description
AT+QFTPOPEN
OPEN AN FTP SERVICE TO THE GIVEN FTP SERVER
AT+QFTPCLOSE
CLOSE THE FTP SERVICE
AT+QFTPPUT
UPLOAD A FILE TO THE FTP SERVER
AT+QFTPGET
DOWNLOAD A FILE FROM THE FTP SERVER
AT+QFTPPATH
SET THE PATH IN THE FTP SERVER TO UPLOAD OR DOWNLOAD
FILE
AT+QFTPUSER
SET THE USER NAME OF THE ACCOUNT TO OPEN FTP SERVICE
AT+QFTPPASS
SET THE PASSWORD OF THE ACCOUNT TO OPEN FTP SERVICE
AT+QFTPCFG
SET SOME CONFIGUABLE PARAMETERS FOR THE FTP SERVICE
AT+QFTPSTAT
QUERY STATUS OF FTP SERVICE
AT+QFTPLEN
QUERY THE REAL SIZE TRANSFERRED IN THE LATEST
TRANSFER
AT+QFTPRENA
ME
RENAME THE FILE OR FILEFOLDER NAME ON THE FTP SERVER
AT+QFTPSIZE
QUERY THE SIZE OF APPOINTED FILE ON THE FTP SERVER
AT+QFTPDELET
E
DELETE THE APPOINTED FILE ON THE FTP SERVER
AT+QFTPMKDI
R
ESTABLISH A NEW FILEFOLDER ON THE FTP SERVER
AT+QFTPRMDIR
REMOVE A FILEFOLDER ON THE FTP SERVER
AT+QFTPLIST
LIST CONTENTS OF DIRECTORY OR FILE INFORMATION ON
THE FTP SERVER
AT+ QFTPNLST
LIST FILE NAMES IN THE GIVEN DIRECTORY ON THE FTP
SERVER
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
GSM_FTP_AT_Commands_Manual_V1.4
-6-
GSM FTP AT Commands Manual
2.2. Detailed Description of AT Commands for FTP Service
2.2.1.
AT+QFTPOPEN Open an FTP service to the given FTP server
AT+QFTPOPEN
Open an FTP service to the given FTP server
Test Command
Response
AT+QFTPOPEN +QFTPOPEN : "HOST NAME",(1-65535)
=?
OK
Parameters
See Write Command
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Read Command
Response
AT+QFTPOPEN +QFTPOPEN :"",(1-65535)
?
OK
Parameters
See Write Command
Write Command Response
AT+QFTPOPEN If format is right, response
="",
Otherwise response
ERROR
Next, if connect successfully, response
+QFTPOPEN:0
Otherwise, response
+QFTPOPEN:
Parameters
The address of the FTP server. It could be an IP address
or a domain name. The maximum size of the parameter
is 100.
The port of the FTP server. The range of the parameter is
1-65535.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Reference
Note:
It is recommended to execute the commands AT+QFTPUSER and
AT+QFTPPASS to set the user name and password before opening
FTP service.
If FTP state is IDLE or CLOSED (Please refer to 2.2.9), the fields of
host name and port in the response of the read command are empty.
GSM_FTP_AT_Commands_Manual_V1.4
-7-
GSM FTP AT Commands Manual
2.2.2.
AT+QFTPCLOSE Close the FTP service
AT+QFTPCLOSE Close the FTP service
Test Command
Response
AT+QFTPCLOS OK
Parameters
E=?
See Write Command
Execution
Response
Command
OK
AT+QFTPCLOS
Next, if the FTP service is closed successfully, response
E
+QFTPCLOSE:0
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Otherwise, response
+QFTPCLOSE:
Parameters
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Reference
2.2.3.
AT+QFTPPUT Upload a file to the FTP server
AT+QFTPPUT
Upload a file to the FTP server
Test Command
Response
AT+QFTPPUT= +QFTPPUT: "FILE NAME",,(1-65535)
?
OK
Parameters
See Write Command
Write Command Response
AT+QFTPPUT= If format is right, response
"",[,]
Otherwise, response
ERROR
Next, if the UART successfully enter data mode, response
CONNECT
Otherwise, response
+QFTPPUT:
Finally, if upload the file successfully, response
+QFTPPUT:
GSM_FTP_AT_Commands_Manual_V1.4
-8-
GSM FTP AT Commands Manual
Otherwise, response
+QFTPPUT:
Parameters
The name of the file to upload. The maximum size of
the parameter is 50.
The size of the file to upload. For the file UFS, RAM
and SD, if was set as 0, it will put the file
according to the real size of the file to put.
The maximum time allowed to get file data. The
default value is 900. The unit is second. The larger
is, should be set longer.
The actual size to upload successfully, theoretically, it
should equals .
A negative numeric to indicate the type of error, please
refer to the chapter 3.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Reference
2.2.4.
Note:
If the length of the input data from UART reaches , or the time
to input data reaches , the FTP service will stop receiving data
from UART.
After CONNECT appears, UART enters to data mode. It is supported
to escape data mode by "+++". Please refer to [2] for the details.
For reliable transmission when uploading file, it is strongly
recommended to enable hardware flow control in both TA side and TE
side. The command "AT+IFC=2,2" is used to enable hardware flow
control in TA side (Please refer to [1] for the details)..
AT+QFTPGET Download a file from the FTP server
AT+QFTPGET Download a file from the FTP server
Test Command
Response
AT+QFTPGET= +QFTPGET: "FILE NAME"
?
OK
Parameters
See Write Command
Write Command Response
AT+QFTPGET= If format is right response
""[,fi OK
leSz]
Otherwise response
ERROR
Next, if the UART successfully enter data mode, response
GSM_FTP_AT_Commands_Manual_V1.4
-9-
GSM FTP AT Commands Manual
CONNECT
Otherwise, response
+QFTPGET:
Finally, if download the file successfully, response
+QFTPGET:
Otherwise, response
+QFTPGET:
Parameters
The name of the file to download. The maximum size
of the parameter is 50.
The max length of the file. Default is 102400. Unit:
byte. It is only used for RAM file. Ignore this
parameter if you use UFS or SD file.
The size of the download file.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Reference
2.2.5.
Note:
After CONNECT appears, UART enters to data mode. It is supported
to escape data mode by "+++". Please refer to [2] for the details.
For reliable transmission when downloading file, it is strongly
recommended to enable hardware flow control in both TA side and TE
side. The command "AT+IFC=2,2" is used to enable hardware flow
control in TA side (Please refer to [1] for the details).
AT+QFTPPATH Set the path in the FTP server to upload or download file
AT+QFTPPATH Set the path in the FTP server to upload or download file
Test Command
Response
AT+QFTPPATH +QFTPPATH: "PATH NAME"
=?
OK
Parameters
See Write Command
Read Command
Response
AT+QFTPPATH OK
?
+QFTPPATH:""
Parameters
See Write Command
Write Command Response
AT+QFTPPATH If format is right, response
GSM_FTP_AT_Commands_Manual_V1.4
- 10 -
GSM FTP AT Commands Manual
="" OK
Otherwise, response
ERROR
Next, if the path is set successfully, response
+QFTPPATH:0
Otherwise, response
+QFTPPATH:
Parameters
The name of the path to set. The maximum size of the
parameter is 100.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Reference
2.2.6.
AT+QFTPUSER Set the user name of the account to open FTP service
AT+QFTPUSER Set the user name of the account to open FTP service
Test Command
Response
AT+QFTPUSER +QFTPUSER: "USER NAME"
=?
OK
Parameters
See Write Command
Read Command
Response
AT+QFTPUSER +QFTPUSER:""
?
OK
Parameters
See Write Command
Write Command Response
AT+QFTPUSER If format is right and the FTP service is idle, response
="" OK
Otherwise, response
ERROR
Parameters
The user name of the account. If it is "", the module
will use anonymous account to open FTP service. The
maximum size of the parameter is 30.
Reference
GSM_FTP_AT_Commands_Manual_V1.4
- 11 -
GSM FTP AT Commands Manual
2.2.7.
AT+QFTPPASS Set the password of the account to open FTP service
AT+QFTPPASS Set the password of the account to open FTP service
Test Command
AT+QFTPPASS
=?
Response
+QFTPPASS: "PASSWORD"
OK
Parameters
See Write Command
Read Command
Response
AT+QFTPPASS? +QFTPPASS:""
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
OK
Parameters
See Write Command
Write Command
AT+QFTPPASS
=""
Response
If format is right and the FTP service is idle, response
OK
Otherwise, response
ERROR
Parameters
The password of the account. The maximum size of the
parameter is 30.
Reference
2.2.8.
AT+QFTPCFG Set some configurable parameters for the FTP service
AT+QFTPCFG Set some configurable parameters for the FTP service
Test Command
Response
AT+QFTPCFG= +QFTPCFG: (1-3)
?
OK
Parameters
See Write Command
Write Command Response
AT+QFTPCFG= If format is right, response
[,] OK
Otherwise, response
ERROR
Next, if the configurable parameter is set successfully, response
GSM_FTP_AT_Commands_Manual_V1.4
- 12 -
GSM FTP AT Commands Manual
+QFTPCFG:0
Else if is default and is legal, this command is used to
query the value of the corresponding parameter, and response
+QFTPCFG:
Otherwise, response
+QFTPCFG:
Parameters
The type of the configurable parameter to set.
1 The mode of data connection.
2 The transfer type
3 The resuming point to resume file transfer
4 The local position of the file to transfer
The value of the parameter to set. The following is the
details about .
If ( == 1)
0
Active mode
1
Passive mode
If ( == 2)
0
Set the transfer type as binary
1
Set the transfer type as ASCII
If ( == 3), it is the resuming point to resume file
transfer.
If ( == 4), it is a string to indicate the local
position of the file to transfer. The following are the
detailed description for the parameter.
"/COM/"
The file data will be input from UART or
output to UART.
"/UFS/"
The file to put is a file saved in UFS and
the received file will be saved in UFS. It is also
supported to specify the file name here. For example,
"?UFS/filename.txt". Then, no matter what the
parameter is in the command
AT+QFTPPUT, it will read the file "filename.txt" in
UFS to put, and the name of the file in the FTP server
is defined by . Likewise, the command
AT+QFTPGET gets the file whose name is defined by
in the FTP server and saves it in UFS with
name "filename.txt".
"/SD/"
The file to transfer is saved in the
Directory “Picture” in SD card. It also support to
specify the file name after the path as similar as in UFS
except the root directory is the directory “Picture” in
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
GSM_FTP_AT_Commands_Manual_V1.4
- 13 -
GSM FTP AT Commands Manual
Reference
2.2.9.
SD card. This is only supported by M33.
"/RAM/"
The file to transfer is saved in RAM. It
also support to specify the file name after the path as
same as in UFS. For the command AT+QFTPGET, no
matter what is the size of the file to get, it will allocate
102400 Bytes’ space for the file. This is only supported
by M33.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Note:
The resuming point will be reset as 0 after file transfer is finished.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
AT+QFTPSTAT Query status of FTP service
AT+QFTPSTAT Query status of FTP service
Test Command
AT+QFTPSTAT
=?
Response
OK
Execution
Command
AT+QFTPSTAT
Response
+QFTPSTAT:
OK
Parameters
Reference
A string indicate the current status of FTP service
IDLE
No FTP service.
OPENING
Opening an FTP service.
OPENED
The FTP service is opened and idle.
WORKING
Sending FTP commands to the FTP
server and receiving response from
the FTP server to start data transfer.
TRANSFER
Transferring data between the
module and the FTP server.
CLOSING
Closing the FTP service.
CLOSED
The FTP service is closed.
Note:
GSM_FTP_AT_Commands_Manual_V1.4
- 14 -
GSM FTP AT Commands Manual
2.2.10. AT+QFTPLEN Query the real size transferred in the latest transfer
AT+QFTPLEN
Query the real size transferred in the latest transfer
Test Command
Response
AT+QFTPLEN= OK
?
Execution
Command
AT+QFTPLEN
Response
+QFTPLEN:
OK
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Parameters
Reference
A numeric to indicate the real size that has been
transferred in the latest transfer operation
(AT+QFTPPUT or AT+QFTPGET).
Note:
2.2.11. AT+QFTPRENAME Rename the file or file folder name on the ftp server
AT+QFTPRENAME Rename the file or file folder name on the ftp server
Test Command
Response
AT+QFTPRENA +QFTPRENAME: ("SOURCE NAME","TARGET NAME")
ME=?
OK
Parameters
See Write Command
Execution
Command
AT+QFTPRENA
ME="",""
Response
If the format is right, response
OK
Otherwise ,response
ERROR
Next, if the file or file folder renamed successfully, response
+QFTPRENAME: 0
Otherwise ,response
+QFTPRENAME:
Parameters
GSM_FTP_AT_Commands_Manual_V1.4
The name of the file or file folder you want to rename,
The limitation of the length of the name is 50.
The name of the file or file folder you want to change t.
- 15 -
GSM FTP AT Commands Manual
Reference
The limitation of the length of the name is 50.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Note:
You can rename file or file folder in sub catalog. The file name and path
name should be like”/dir/source name” and ”/dir/target name”. Source
name and target name can be in different catalog.
2.2.12. AT+QFTPSIZE Query the size of appointed file on the ftp server
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
AT+QFTPSIZE
Query the size of appointed file on the ftp server
Test Command
Response
AT+QFTPSIZE= +QFTPSIZE: "FILE NAME"
?
OK
Parameters
See Write Command
Execution
Response
Command
If the format is right, response
AT+QFTPSIZE= OK
""
Otherwise ,response
ERROR
Next, if the file size queried successfully, response
+QFTPSIZE:
Otherwise ,response
+QFTPSIZE:
Parameters
Reference
The name of the file you want to check size. The
limitation of the length of the name is 50.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Note:
If you want to get size of file in sub catalog, the file name should be
like ”/dir/fileName”.
GSM_FTP_AT_Commands_Manual_V1.4
- 16 -
GSM FTP AT Commands Manual
2.2.13. AT+QFTPDELETE Delete the appointed file on the ftp server
AT+QFTPDELETE Delete the appointed file on the ftp server
Test Command
Response
AT+QFTPDELE +QFTPDELETE: "FILE NAME"
TE=?
OK
Parameters
See Write Command
Execution
Command
AT+QFTPDELE
TE=""
Response
If the format is right, response
OK
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Otherwise ,response
ERROR
Next, if the file delete successfully, response
+QFTPDELETE:0
Otherwise ,response
+QFTPDELETE:
Parameters
Reference
The name of the file you want to delete. The limitation
of the length of the name is 50.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Note:
If you want to delete file in sub catalog, the file name should be
like ”/dir/fileName”.
2.2.14. AT+QFTPMKDIR Establish a new file folder on the ftp server
AT+QFTPMKDIR
Establish a new file folder on the ftp server
Test Command
Response
AT+QFTPMKDI +QFTPMKDIR: "PATH NAME"
R=?
OK
Parameters
See Write Command
Execution
Command
AT+QFTPMKDI
R=""
Response
If the format is right, response
OK
Otherwise ,response
GSM_FTP_AT_Commands_Manual_V1.4
- 17 -
GSM FTP AT Commands Manual
ERROR
Next, if the file folder established successfully, response
+QFTPMKDIR:0
Otherwise ,response
+QFTPMKDIR:
Parameters
The name of the file folder you want to establish. The
limitation of the length of the name is 100.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Reference
Note:
This command cannot used to make sub file folder.
2.2.15. AT+QFTPRMDIR Remove a file folder on the ftp server
AT+QFTPRMDIR
Remove a file folder on the ftp server
Test Command
Response
AT+QFTPRMDI +QFTPRMDIR: "PATH NAME"
R=?
OK
Parameters
See Write Command
Execution
Command
AT+QFTPRMDI
R=""
Response
If the format is right, response
OK
Otherwise ,response
ERROR
Next, if the file folder established successfully, response
+ QFTPRMDIR:0
Otherwise ,response
+ QFTPRMDIR:
Parameters
Reference
The name of the file folder you want to remove. The
limitation of the length of the name is 100.
A negative numeric to indicate the type of error, please
refer to the chapter 3.
Note:
This command can be only used to remove empty file folder.
GSM_FTP_AT_Commands_Manual_V1.4
- 18 -
GSM FTP AT Commands Manual
2.2.16. AT+QFTPLIST List contents of directory or file information on the ftp server
AT+QFTPLIST List contents of directory or file information on the ftp server
Test Command
Response
AT+QFTPLIST= +QFTPLIST: "NAME"
?
OK
Parameters
See Write Command
Write
Command
AT+QFTPLIST
[=""]
Response
If format is right response
OK
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Otherwise response
ERROR
Next, if the UART successfully enter data mode, response
CONNECT
Otherwise, response
+QFTPLIST:
Finally, if list the directory information successfully, response
+QFTPLIST:
Otherwise, response
+QFTPLIST:
Parameters
A directory name or file name. The type is string. The
maximum size of the parameter is 50.
ret = 1, represent OK; ret = 0, represent no information
transferred from FTP.
A negative numeric to indicate the type of error, please
refer to the Summary of Error Codes.
Reference
Note:
If the name is a regular file, it will response the information about that
file; if the name is a directory, it will response the contents of the
directory.
If the name was ignored, it will list the contents of the current
directory; else it will base on the current directory.
Please make sure the local position is /COM/. You can set it by
AT+QFTPCFG=4, “/COM/”.
GSM_FTP_AT_Commands_Manual_V1.4
- 19 -
GSM FTP AT Commands Manual
2.2.17. AT+QFTPNLST List file names in the given directory on the ftp server
AT+ QFTPNLST List file names in the given directory on the ftp server
Test Command
Response
AT+QFTPNLST + QFTPNLST: "DIR NAME"
=?
OK
Parameters
See Write Command
Write
Response
Command
If format is right response
AT+ QFTPNLST OK
[=""]
Otherwise response
ERROR
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Next, if the UART successfully enter data mode, response
CONNECT
Otherwise, response
+ QFTPNLST:
Finally, if list the directory information successfully, response
+ QFTPNLST:
Otherwise, response
+ QFTPNLST:
Parameters
A directory name. The type is string. The maximum
size of the parameter is 50.
ret = 1, represent OK; ret = 0, represent no information
transferred from FTP.
A negative numeric to indicate the type of error, please
refer to the Summary of Error Codes.
Reference
Note:
It returns just file names in the given directory,
Please make sure the local position is /COM/. You can set it by
AT+QFTPCFG=4, “/COM/”.
GSM_FTP_AT_Commands_Manual_V1.4
- 20 -
GSM FTP AT Commands Manual
3. Summary of Error Codes
When no command is executed and some error happens, The FTP service will report the URC
"+QFTPERROR:". The error code indicates an error related to mobile
equipment or network. The detail about is described in the following table.
Meaning
-1
Unknown error
-3
The FTP service is busy. Such as, opening FTP service, controlled by
another virtual UART, etc.
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-421
-425
-426
-450
-452
-500
-501
-502
-530
-532
-550
-551
-552
-553
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Failed to get IP address according to domain name
Network error. Such as, failed to activate GPRS/CSD context, failed to
establish the TCP connection with the FTP server or failed to send FTP
command to the FTP server, etc.
The FTP session is closed by the FTP server
The data connection of the FTP service is closed by the FTP server
GPRS/CSD context is deactivated
Timeout
The input parameter is illegal
The file is not found in the local position, UFS or SD or RAM
Failed to get the file in the local position, UFS or SD or RAM.
No enough memory for attachment
The FTP server can’t support service
Failed to open data connection
The connection is closed and stop transferring
The request for the file isn’t operated
The FTP server has not enough memory
The format of the FTP command is wrong
The parameter of the FTP command is wrong
The FTP command isn’t operated by the FTP server
Not login the FTP server
Need the information of account
The request is not operated
The request is stopped
The request of a file is stopped
File name is illegal
GSM_FTP_AT_Commands_Manual_V1.4
- 21 -
GSM FTP AT Commands Manual
4. Examples
4.1. Open an FTP service
AT+QIFGCNT=0 //choose the context 0 to activate GPRS/CSD context for the FTP service,
please refer to [1] and [2].
OK
AT+QICSGP=1,”CMNET”
OK
//choose GPRS mode and set the APN as "CMNET"
AT+QFTPUSER="quectel"
OK
//set the user name as "quectel"
AT+QFTPPASS="123456"
OK
//set the password as "123456"
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
AT+QFTPOPEN="quectel.3322.org",21 //visit the FTP server "quectel.3322.org:21"
OK
……
//wait for a moment
+QFTPOPEN:0
//successfully open the FTP service.
Note:
Actually, the FTP server "quectel.3322.org:21" does not exist. It is just an example. Besides,
it is strongly recommended to execute all the former commands only when SIM PIN is
unlocked.
4.2. Upload a file to FTP server
After the FTP service is opened, it is OK to upload a file to the FTP server and download a file
from the FTP server. The following are examples explain how to upload file.
4.2.1.
Upload a file through UART
AT+QFTPPATH="/"
OK
//set the path to upload file as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPPUT="sscom.ini",1587,200
//upload the file "sscom.ini" whose size is 1587, and
GSM_FTP_AT_Commands_Manual_V1.4
- 22 -
GSM FTP AT Commands Manual
the maximum time to input file data is 200 seconds
OK
CONNECT
……
+QFTPPUT:1587
4.2.2.
//successfully open data connection to upload file
//input the data of the file "sscom.ini"
//successfully upload the file "sscom.ini" to the FTP
server. The size of the data successfully uploaded is
1587.
Upload a file in UFS
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
AT+QFTPCFG=4,"/UFS/"
OK
//set the local position as UFS.
+QFTPCFG:0
//successfully to set the local position.
AT+QFTPPATH="/"
OK
//set the path to upload file as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPPUT="sscom.ini",1587,200
//upload the file "sscom.ini" in UFS, and the size
expected to put is 1587. If the real size of the file
"sscom.ini" is less than 1587, it will upload file with
the real size. The maximum time to read file data is
200 seconds
OK
+QFTPPUT:1587
4.2.3.
//successfully upload the file "sscom.ini" to the FTP
server. The size of the data successfully uploaded is
1587.
Upload a file in RAM
AT+QFTPCFG=4,"/RAM/"
OK
//set the local position as RAM.
+QFTPCFG:0
//successfully to set the local position.
AT+QFTPPATH="/"
OK
//set the path to upload file as "/"
GSM_FTP_AT_Commands_Manual_V1.4
- 23 -
GSM FTP AT Commands Manual
+QFTPPATH:0
//successfully set the path
AT+QFTPPUT="sscom.ini",1587,200
//upload the file "sscom.ini" in RAM, and the size
expected to put is 1587. If the real size of the file
"sscom.ini" is less than 1587, it will upload file with
the real size. The maximum time to read file data is
200 seconds
OK
+QFTPPUT:1587
//successfully upload the file "sscom.ini" to the FTP
server. The size of the data successfully uploaded is
1587.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Note:
It is supported to upload a file in the Directory “Picture” of SD card with the similar method as
the former example in M33. The only difference is to replace "AT+QFTPCFG=4,"/UFS/"" with
"AT+QFTPCFG=4,"/SD/"".
4.2.4.
Upload a specified file in UFS
AT+QFTPCFG=4,"/UFS/test.txt"
OK
//set "test.txt" in UFS as the local file to put or get.
+QFTPCFG:0
//successfully to set the local file.
AT+QFTPPATH="/"
OK
//set the path to upload file as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPPUT="sscom.ini",1587,200
//upload the file "test.txt" in UFS and modify its
name as "sscom.ini" in the FTP server, and the size
expected to put is 1587. If the real size of the file
"sscom.ini" is less than 1587, it will upload file with
the real size. The maximum time to read file data is
200 seconds
OK
+QFTPPUT:1587
GSM_FTP_AT_Commands_Manual_V1.4
//successfully upload the file "sscom.ini" to the FTP
server. The size of the data successfully uploaded is
1587.
- 24 -
GSM FTP AT Commands Manual
Note:
It is supported to upload a specified file in the Directory “Picture” of SD card with the similar
method as the former example in M33. The only difference is to replace
"AT+QFTPCFG=4,"/UFS/test.txt"" with "AT+QFTPCFG=4,"/SD/test.txt"". Of course,
"test.txt" must be a file in the directory "Picture" in SD card.
4.3. Download a file from FTP server
The following examples explain how to download file.
4.3.1.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Download a file through UART
AT+QFTPPATH="/"
OK
//set the path to download file as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPGET="sscom.ini"
OK
//download the file "sscom.ini" from the FTP server.
CONNECT
……
+QFTPGET:1587
//successfully open data connection to download file.
//the data of the file "sscom.ini" outputs from UART.
//successfully download the file "sscom.ini" from the
FTP server. And the size of the data successfully
downloaded is 1587. Of course, this sentence is
possible the content of the file "sscom.ini". So, it is
recommended to execute the command AT later to
confirm whether the file has been downloaded over.
//input AT from UART.
//there is an OK response for AT, which means the
download operation is finished.
AT
OK
4.3.2.
Download a file into UFS
AT+QFTPCFG=4,"/UFS/"
OK
// set the local position as UFS.
+QFTPCFG:0
//successfully to set the local position.
AT+QFTPPATH="/"
OK
//set the path to download file as "/"
GSM_FTP_AT_Commands_Manual_V1.4
- 25 -
GSM FTP AT Commands Manual
+QFTPPATH:0
//successfully set the path
AT+QFTPGET="sscom.ini"
//download the file "sscom.ini" from the FTP server
and save it in UFS with name "sscom.ini".
OK
+QFTPGET:1587
//successfully download the file "sscom.ini" from the
FTP server. And the size of the data successfully
downloaded is 1587.
Note:
It is supported to download a file into the Directory “Picture” of SD card with the similar method
as the former example in M33. The only difference is to replace "AT+QFTPCFG=4,"/UFS/""
with "AT+QFTPCFG=4,"/SD/"".
4.3.3.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Download a file into a specified file in UFS
AT+QFTPCFG=4,"/UFS/dwl.txt"
OK
//set the local position as UFS and the data from
server will be saved in the file "dwl.txt".
+QFTPCFG:0
AT+QFTPPATH="/"
OK
//successfully to set the local position.
//set the path to download file as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPGET="sscom.ini"
//download the file "sscom.ini" from the FTP
server and save it in UFS with name "dwl.txt".
OK
+QFTPGET:1587
4.3.4.
//successfully download the file "sscom.ini" from
the FTP server. And the size of the data
successfully downloaded is 1587.
Download a file into RAM
AT+QFTPCFG=4,"/RAM/dwl.txt"
//set the local position as RAM and the data from
server will be saved in the file "dwl.txt".
OK
GSM_FTP_AT_Commands_Manual_V1.4
- 26 -
GSM FTP AT Commands Manual
+QFTPCFG:0
//successfully to set the local position.
AT+QFTPPATH="/"
OK
//set the path to download file as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPGET="sscom.ini",1587
//download the file "sscom.ini" from the FTP
server and save it in RAM with name "dwl.txt".
The second parameter “1587” means a file is
created in RAM, the file size is 1587. If you ignore
this parameter, the default size is 102400. Please
keep this parameter bigger than the size of file you
want to get in FTP server.
OK
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
+QFTPGET:1587
//successfully download the file "sscom.ini" from
the FTP server. And the size of the data
successfully downloaded is 1587.
Note:
It is supported to download a file and save it into a specified file in the Directory “Picture” of
SD card with the similar method as the former example in M33. The only difference is to
replace "AT+QFTPCFG=4,"/UFS/dwl.txt"" with "AT+QFTPCFG=4,"/SD/dwl.txt"".
4.4. Operate a file or a file folder on the FTP
4.4.1.
Operate a file on the FTP server
AT+QFTPRENAME="sscom.ini","test.txt"
OK
//rename the file”sscom.ini” to “test.txt”
+QFTPRENAME:0
AT+QFTPSIZE=" test.txt "
OK
//successfully rename the file
//query the size of file”test.txt”
+QFTPSIZE:17765
//successfully query the file size, and the file
size is 17765
AT+QFTPDELETE="test.txt"
OK
+QFTPDELETE:0
GSM_FTP_AT_Commands_Manual_V1.4
//delete the renamed file “test.txt”
// successfully delete the file
- 27 -
GSM FTP AT Commands Manual
4.4.2.
Operate a file folder on the FTP server
AT+QFTPMKDIR="test"
OK
//establish a new file folder on the FTP
+QFTPMKDIR:0
AT+QFTPRENAME="test","test1"
OK
//successfully make the new file folder
//rename the file folder “test” to “test1”
+QRENAME:0
AT+QFTPRMDIR="test1"
OK
//successfully rename the file folder
//delete the renamed file folder “test1”
+QFTPMKDIR:0
// successfully remove the file folder
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
Note:
If the file or file folder dose not exist, it will return error:550. If there are problems on the
connection, it will return error:-1.
4.5. Resume file at the resuming point
While uploading or downloading file, the process may be interrupted because of
disconnection. At this time, it is waste to transfer the data that has been transferred. Quectel
Module supports to transfer file at the resuming point if the server supports this function so
that it is unnecessary to retransfer the data that has been transferred. And this function makes
it possible to split a huge file into several small parts and then upload the file part by part. It is
necessary to execute the command "AT+QFTPCFG=3," before putting or
getting remaining data. Please refer to the following examples.
4.5.1.
Upload a file to FTP server from the resuming point
AT+QFTPPUT="sscom.ini",1587,200 //upload the file "sscom.ini". The total size is
3587, and here just upload 1587 bytes for the first
time. The remaining data of 2000 bytes can be
uploaded later.
OK
CONNECT
……
+QFTPPUT:1587
GSM_FTP_AT_Commands_Manual_V1.4
//successfully open data connection to upload file
//input the data of the file "sscom.ini"
//successfully upload 1587 bytes of the file
"sscom.ini" to the FTP server.
- 28 -
GSM FTP AT Commands Manual
AT+QFTPCFG=3,1587
OK
//set the resuming point.
+QFTPCFG:0
AT+QFTPPUT="sscom.ini",2000,200 //upload the remaining 2000 bytes of the file
"sscom.ini" to the server.
OK
CONNECT
……
//input the rest data of the file "sscom.ini" from the
position 1587
//successfully upload the rest 2000 bytes
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
+QFTPPUT:2000
Note:
If the file to put was saved in UFS or SD or RAM, it will put the file from the resuming point. For
example: the size of the file to put is 5120 and the resuming point was set as 1587, then it will
upload the data from 1587 to 3586 (including it) in the file to put. If the size of the file is less than
3587, it will upload the data from 1587 to the end of the file.
4.5.2.
Download a file from FTP server from the resuming point
Similar as uploading, it is supported to download file from the resuming point. For example,
if file “sscom.ini” has been downloaded 1587 bytes, while the total size is 3587 bytes. It is
supported to download the rest data from the position 1587.
AT+QFTPCFG=3,1587
OK
+QFTPCFG:0
AT+QFTPGET="sscom.ini"
OK
CONNECT
……
+QFTPGET:2000
//Set the resuming point.
//download the rest data of "sscom.ini" from the
FTP server.
//the data of the file "sscom.ini" started from the
position 1587 outputs from UART
//successfully download the rest file of 2000 bytes
from the FTP server.
Note:
If the downloaded file was expected to save in UFS or SD or RAM, it will put the received data in
the file to save from the resuming point. For example: the resuming point was set as 1587 and the
original size to save the received data is not less than 1587, then the received data will be put into
the file to save from 1587. If the size of the file is less than 1587, it will return error
GSM_FTP_AT_Commands_Manual_V1.4
- 29 -
GSM FTP AT Commands Manual
"+QFTPGET:-12".
4.6. Get FTP list
Get the contents of directory or file information on the ftp server.
AT+QFTPPATH="/"
OK
//set the current path as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPCFG=4,"/COM/"
OK
//set the local position as COM
+QFTPCFG:0
//successfully to set the local position.
AT+QFTPLIST
OK
//list the contents of current directory
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
CONNECT
-rw-rw-rw-
1 user
group
239 Jul 18 15:45 #.dat
………………
………………
drw-rw-rw-
1 user
group
0 Jul 16 14:14 tsj
+QFTPLIST: 1
AT+QFTPLIST="ANDY"
OK
CONNECT
-rw-rw-rw-
1 user
//list the contents in the directory of “andy”
group
0 Mar 17 17:21 1.text
group
10 Jun 20 10:18 test.txt
………………
………………
-rw-rw-rw-
1 user
+QFTPLIST: 1
Note:
Please make sure the local position is “/COM/”, you can use AT+QFTPCFG=4,"/COM/" to set
it.
GSM_FTP_AT_Commands_Manual_V1.4
- 30 -
GSM FTP AT Commands Manual
4.7. Get FTP file name list
Get the list of file names in the specified directory.
AT+QFTPPATH="/"
OK
//set the current path as "/"
+QFTPPATH:0
//successfully set the path
AT+QFTPCFG=4,"/COM/"
OK
//set the local position as COM
+QFTPCFG:0
//successfully to set the local position.
AT+QFTPNLST
OK
// list file names of current directory
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
CONNECT
Aaa.jpg
………………
………………
Test.txt
+QFTPNLST: 1
AT+QFTPNLST="ANDY"
OK
// list the file names in the directory of”andy”
CONNECT
Mytest.txt
………………
………………
Mytest.jpg
+QFTPNLST: 1
Note:
Please make sure the local position is “/COM/”, you can use AT+QFTPCFG=4,"/COM/" to set
it.
4.8. Close the FTP service
AT+QFTPCLOSE
GSM_FTP_AT_Commands_Manual_V1.4
//close the connection with FTP
- 31 -
GSM FTP AT Commands Manual
OK
+QFTPCLOSE:0
//successfully close the connection
AT+QIDEACT
//de-act the context
DEACT OK
//de-act successfully
Generally, if the FTP service is not used for a time of period, the FTP server will indicate the user
that the FTP service cannot be used. The module will report "+QFTPERROR:-421" for this
information. After a moment, the FTP server will close the control connection of the FTP service.
And the module will report "+QFTPERROR:-6" for this information. It is recommended to
execute the command "AT+QFTPCLOSE" to close the FTP service after receiving these two
report messages from UART.
l
e
t
l
c
a
e
i
t
u
n
Q ide
f
n
o
C
GSM_FTP_AT_Commands_Manual_V1.4
- 32 -
Quectel Wireless Solutions Co., Ltd.
Room 501, Building13, No.99, Tianzhou Road, Shanghai, China 200233
Tel: +86 21 5108 6236
Mail: info@quectel.com
Source Exif Data:
File Type : PDF
File Type Extension : pdf
MIME Type : application/pdf
PDF Version : 1.5
Linearized : No
Has XFA : No
Language : zh-CN
XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04
Format : application/pdf
Creator : Colin.Hu
Create Date : 2015:04:08 14:46:10+08:00
Creator Tool : Microsoft® Word 2010
Modify Date : 2015:04:08 14:47+08:00
Metadata Date : 2015:04:08 14:47+08:00
Producer : Microsoft® Word 2010
Document ID : uuid:0f76f3a6-18ba-4712-8b13-a1dd882f832f
Instance ID : uuid:486294e6-10fa-47b5-a243-cb68e8014918
Page Mode : UseOutlines
Page Count : 34
Author : Colin.Hu
EXIF Metadata provided by EXIF.tools