Read file size through FTP connection



Not so long ago (in a galaxy far far away :laughing: ), I began using a Q24 Wavecom chip to send data through FTP. I manage to connect to the server, send file and close the connection, but sometimes when I check the server with my FTP Client, the uploaded file is not there : it was sent by the modem, but I dunno where it arrived.

To solve this problem, I was thinking that maybe, after transmission, I could ask the server if the file is present, and read its size to compare it with the size of the file I wanted to send. Is there a way to perform such check ? In the AT manual, I only find topics related to uploading or downloading file, and no other action…

Thanks for your help/advices !


It sounds mysterious, maybe somebody is using the dark force? :slight_smile:

Anyhow , look around the wip_getFileSize() function. You will see the filesize in the content.done.aux parameter oft the wip_event_t in the FTP handler.



The way I understand it, he’s using AT commands, not OpenAT :frowning:


Yes, you are right. I didn’t notice he mentioned AT manual, which must be the WIP AT manual. Unfortunately, i am not familier with Wipsoft. Maybe, he should look at the latest document and see if there is any update on the examples/commands. He can download the file after sending it and compare the contents, if there is no other way. ( I know this is not a nice method, and it should be completely unnecessary using the FTP protocol )

Any other idea?


Well, fft is right : I always forget to mention I’m using AT commands. To be more precise, I programm a PIC microcontroller to send AT commands to the Wavecom chip through its RS232 connection : the PIC reads datas stored in an external EEPROM and writes them into a TXT file on a remote server, using the FTP connection. Now, you know what I’m working on ! :wink:

About the lost files, I doubt I can blame a Sith lord. Two weeks ago, I received a new firmware for my modem, and the release note says it corrects some FTP problems in the way error messages are handled. Maybe that could explain why I had all confirmations for my commands, even though the file was not sent. I updated the firmware in 1 modem only at the moment, and didn’t have time yet to check if this weird situation happens again.

But still I’m worried about corrupted files : reading the file back and comparing it to the source sounds to me like the worse thing to do. I was really hoping that there would be an AT command to request a file’s size, but it seems not. It exists in Open AT though (yes, tomalex, you were right), but it’s not helping me. :frowning:



if you’re doing PIC-driving-through-AT-commands, you’d probably be much better off running Open AT Lua, if your WCPU supports it. As a bonus, you might also save some PCB and chip costs, in addition to development/debug/long term maintenance time.



I want to read bmp file through ftp.