How to send a file from a SD card to an FTP server...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to send a file from a SD card to an FTP server...

Jump to solution
1,076 Views
KineX
Contributor II

Hi,

 

I am able to create file on the SD card usign MFS... and I am able to connect to a FTP server using RTCS.... but if I want to send a file to an FTP server using RTCS... how I get access to my files?

 

I tried:

 

FTP_command_data(handle, "STOR a:test.txt\r\n", stdout,          stdout, FTPMODE_PORT | FTPDIR_RECV);

 

before using this I mounted my SD as a: like in the tower demo...

 

and the test.txt file exists on the SD card...

 

Maybe I missed an information in the doc...

 

Thank you

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
437 Views
KineX
Contributor II

Sorry I was wrong all the way...

 

 

For the ones that are interested...

 

fd is a file pointer opened in read for the file you want to transfer...

 

And don't forget to put the right direction... FTPDIR_SEND ... 

 

response = FTP_command_data(handle, "STOR test.txt\r\n", stdout, fd, FTPMODE_PORT | FTPDIR_SEND);

 

As always! RTFM!

 

Best regards

 

View solution in original post

0 Kudos
1 Reply
438 Views
KineX
Contributor II

Sorry I was wrong all the way...

 

 

For the ones that are interested...

 

fd is a file pointer opened in read for the file you want to transfer...

 

And don't forget to put the right direction... FTPDIR_SEND ... 

 

response = FTP_command_data(handle, "STOR test.txt\r\n", stdout, fd, FTPMODE_PORT | FTPDIR_SEND);

 

As always! RTFM!

 

Best regards

 

0 Kudos