Sending multiple files via FTP | Thales IoT Developer Community
July 19, 2015 - 12:03am, 3289 views
Is there a way to avoid opening / closing a FTP session between each file passed via FTP??
I am looking at seeing if there is a method for sending multiple files once a session is open.
If I update 1 file, then send EOD to close it, wait untit ^sisw:1, 1 response.
If I then try and send another file by updating the "files" parameter for the next file transfer - just returns ERROR.
Is there a way of sending multiple files via FTP without closing the FTP session between FTP file transmissions ??
Hello,
You specify the parameters before opening the connection and can't change it when it's open.
But you can send or download up to 5 files in a similar way as for SMTP. Please see "cmd" and "files" parameters of AT^SISS command in the AT commands specification document.
Best regards,
Bartłomiej
I can see this working if the files are already created, ie on the FFS.
However i wish to create in turn a filename and then add data to that via the at^sisw, and repeat this with different filenames and data -is this possible ??. If the parameters are set prior to opening the session then I cannot see how the at^sisw can be used to add data to each of the 5 possible files created / opened on the FTP Server. I am trying to avoid the overhead of creating / closing a separate FTP session for each file, if that is possible.
Hello,
To avoid opening and closing ftp connection you would need to create the files on the module's file system with AT^SFSA command before opening the connection, then send these files and delete after closing the connection.
Regards,
Bartłomiej
Unfortunately that would create other issues for me, since each of the files would need to be < 950 bytes (other systems might accept up to 1500 bytes but mine stops above 950 bytes). This would mean recombining the files when received and I would still need to use several sessions due to the volume of data, which would need more than 5 files.
At least I now know where the system limits are and design accordingly.
Thank you for your reply.
Hello,
5 files per session is the limit for AT commands SMTP session.
I don't know your system and if you are using Java on the module - you could implement SMTP in Java as the alternative for AT commands.
Regards,
Bartłomiej
Thank you for your reply. As indicated in another posting the use of SMTP would have a file limit of 1000 bytes when using cmd=AT and at^sisw.
It would seem for larger file sizes the use of FFS is the way to go for SMTP or FTP to avoid file size limits (SMTP) and get-round the multiple opening / closing session ***** (FTP).