RTX+HTTP+FTP+Telnet+SNMP. problem with uploading via FTP

Good day.

board: MCB1700

I've tried all services from SUBJ separatelly. All of them works fine including FTP uploading to the SD-based file system. Then I've joined all of them into the single project.
Now FTP's work has some limits: I can download files from SD, I can remove files from SD. But, if I'm trying to upload any files to SD via FTP then crated file has length 0 bytes. Probably some settings missed or meshed.

Thank you in advance for any advice.

Parents
  • No errors indicates in ftp_fclose and ftp_fwrite procedures:

    /*--------- ftp_fclose -------------------------*/
    
    void ftp_fclose (void *file) {
      /* Close the file opened for reading or writing. */
      if (fclose (file)==0){
              GLCD_ClearLn (6);
              GLCD_DisplayString(6, 0, "File closed");
      }
      else{
              GLCD_ClearLn (6);
              GLCD_DisplayString(6, 0, "Error in file closing");
      }
    }
    /*--------------- ftp_fwrite ---------------------*/
    
    U16 ftp_fwrite (void *file, U8 *buf, U16 len) {
      /* Write 'len' bytes from buffer 'buf' to a file. */
      U16 x;
      x=fwrite (buf, 1, len, file);
      if (x<len){
              GLCD_ClearLn (5);
              GLCD_DisplayString(5, 0, "Error in write");
      }
      else{
              GLCD_ClearLn (5);
              GLCD_DisplayString(5, 0, "Write done");
      }
    
      //return (fwrite (buf, 1, len, file));
      return x;
    }
    

    What else could be checked for debugging?

Reply
  • No errors indicates in ftp_fclose and ftp_fwrite procedures:

    /*--------- ftp_fclose -------------------------*/
    
    void ftp_fclose (void *file) {
      /* Close the file opened for reading or writing. */
      if (fclose (file)==0){
              GLCD_ClearLn (6);
              GLCD_DisplayString(6, 0, "File closed");
      }
      else{
              GLCD_ClearLn (6);
              GLCD_DisplayString(6, 0, "Error in file closing");
      }
    }
    /*--------------- ftp_fwrite ---------------------*/
    
    U16 ftp_fwrite (void *file, U8 *buf, U16 len) {
      /* Write 'len' bytes from buffer 'buf' to a file. */
      U16 x;
      x=fwrite (buf, 1, len, file);
      if (x<len){
              GLCD_ClearLn (5);
              GLCD_DisplayString(5, 0, "Error in write");
      }
      else{
              GLCD_ClearLn (5);
              GLCD_DisplayString(5, 0, "Write done");
      }
    
      //return (fwrite (buf, 1, len, file));
      return x;
    }
    

    What else could be checked for debugging?

Children
More questions in this forum