Giter Site home page Giter Site logo

Comments (7)

UNOSweeper avatar UNOSweeper commented on May 26, 2024 1

After playing around with the code of your published example ESP32_FTPClient/examples/download_file/download_file.ino I can tell you now that by simply deleting, removing or commenting list[i].toLowerCase(); at line 77 of your code will solve the problem. Then the complete sketch will works as you intended. This is the case when using the FTP server of 000webhost.com.
Using the FTP server of my own ISP then I have to add ftp.CloseFile() before a next ftp.InitFile() is sent to let the sketch working correctly (same experience as with your ESP32_FTPClient/examples/upload_image/upload_image.ino. See issue #30).

from esp32_ftpclient.

UNOSweeper avatar UNOSweeper commented on May 26, 2024

.Sorry for using the three Serial monitor output text as a link. Maybe there is another way, which I did not find.

from esp32_ftpclient.

ldab avatar ldab commented on May 26, 2024

If you believe there is an issue with the library, please share the code you used, the output of the terminal and the detailed steps on how to reproduce it.

from esp32_ftpclient.

UNOSweeper avatar UNOSweeper commented on May 26, 2024

If I haven't written the issue in enough detail I apologize.
I do not know where the issue is, but if you like to download myPhoto.png into a new map myNewDir, then that does not succeed with your example file ESP32_FTPClient/examples/download_file/download_file.ino
And according this sketch it is supposed that there must already exist a file myPhoto.png in the working directory on the server.

Below is described what I have done.
I downloaded your file ESP32_FTPClient/examples/download_file/download_file.ino.
I changed in that file the credentials at line 16...21
I changed the path on line 47 and 109 of your working directory into my working directory (public_html/xxx) at 000webhost.com .
I changed line 23 of the sketch into ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000,2); to have Verbose=2.
Then the sketch is:

/******************************************************************************

ESP32-CAM remote image access via FTP. Take pictures with ESP32 and upload it via FTP making it accessible for the outisde network. 
Leonardo Bispo
July - 2019
https://github.com/ldab/ESP32_FTPClient

Distributed as-is; no warranty is given.

******************************************************************************/
#include "Arduino.h"
#include <WiFi.h>
#include <WiFiClient.h> 
#include <ESP32_FTPClient.h>

#define WIFI_SSID ""
#define WIFI_PASS ""

char ftp_server[] = "files.000webhost.com";
char ftp_user[]   = "";
char ftp_pass[]   = "";

ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000,2);

void setup()
{
  Serial.begin( 115200 );

  WiFi.begin( WIFI_SSID, WIFI_PASS );
  
  Serial.println("Connecting Wifi...");
  while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
  }
  Serial.println("");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  Serial.print("\nMax Free Heap: ");
  Serial.println(ESP.getMaxAllocHeap());
  Serial.println("");

  ftp.OpenConnection();

  //Change directory
  ftp.ChangeWorkDir("/public_html/xxx");

  // Create a new file to use as the download example below:
  ftp.InitFile("Type A");
  ftp.NewFile("helloworld.txt");
  ftp.Write("Hi, I'm a new file");
  ftp.CloseFile();

  //Download the text file or read it
  String response = "";
  ftp.InitFile("Type A");
  ftp.DownloadString("helloworld.txt", response);
  Serial.println("The file content is: " + response);

  // Get the file size
  const char * fileName = "myPhoto.png";
  size_t       fileSize = 0;
  String       list[128];

  // Get the directory content in order to allocate buffer
  // my server response is type=file;size=18;modify=20190731140703;unix.mode=0644;unix.uid=10183013;unix.gid=10183013;unique=809g7c8e92e4; helloworld.txt
  ftp.InitFile("Type A");
  ftp.ContentList("", list);
  for( uint8_t i = 0; i < sizeof(list); i++)
  {
    uint8_t indexSize = 0;
    uint8_t indexMod  = 0;

    if(list[i].length() > 0)
    {
      list[i].toLowerCase();
      
      if( list[i].indexOf(fileName) > -1 )
      {
        indexSize = list[i].indexOf("size") + 5;
        indexMod  = list[i].indexOf("modify") - 1;

        fileSize = list[i].substring(indexSize, indexMod).toInt();
      }

      // Print the directory details
      Serial.println(list[i]);
    }
    else
      break;
  }

  // Print file size
  Serial.println("\nFile size is: " + String(fileSize));

  //Dynammically alocate buffer
  unsigned char * downloaded_file = (unsigned char *) malloc(fileSize);

  // And download the file
  ftp.InitFile("Type I");
  ftp.DownloadFile(fileName, downloaded_file, fileSize, false);

  //Create a new Directory
  ftp.InitFile("Type I");
  ftp.MakeDir("myNewDir");

  //Enter the directory
  ftp.ChangeWorkDir("/public_html/xxx/myNewDir");

  //And upload the file to the new directory
  ftp.NewFile( fileName );
  ftp.WriteData(downloaded_file, fileSize);
  ftp.CloseFile();

  free(downloaded_file);

  ftp.CloseConnection();
}

void loop()
{

}

I compiled and uploaded the sketch to an AI Thinker ESP32-cam module (with integrated ESP32-CAM-MB with USB conn.)

The Serial Monitor output was:
`13:54:10.279 -> Connecting Wifi...
13:54:10.786 -> ...
13:54:11.756 -> IP address: 192.168.8.100
13:54:11.756 ->
13:54:11.756 -> Max Free Heap: 110580
13:54:11.756 ->
13:54:11.756 -> Connecting to: files.000webhost.com
13:54:11.985 -> Command connected
13:54:12.405 -> Send USER
13:54:12.823 -> Send PASSWORD
13:54:13.238 -> Send SYST
13:54:13.423 -> Send CWD
13:54:13.654 -> Send TYPE
13:54:13.654 -> Type A
13:54:13.839 -> Send PASV
13:54:14.069 -> Data port: 47946
13:54:14.255 -> Data connection established
13:54:14.255 -> Send STOR
13:54:14.577 -> Write File
13:54:14.577 -> Close File
13:54:14.764 -> Send TYPE
13:54:14.764 -> Type A
13:54:14.994 -> Send PASV
13:54:15.273 -> Data port: 38567
13:54:15.505 -> Data connection established
13:54:15.505 -> Send RETR
13:54:15.688 -> Result start
13:54:15.688 -> Result: 150 Connecting to port 47647
13:54:15.688 -> 226-File successfully transferred
13:54:15.688 -> 226 0.000 seconds (measured here), 228.26 Kbytes per second
13:54:15.688 -> Result end
13:54:16.702 -> The file content is: Hi, I'm a new file
13:54:16.702 -> Send TYPE
13:54:16.702 -> Type A
13:54:16.933 -> Send PASV
13:54:17.534 -> Data port: 40847
13:54:17.721 -> Data connection established
13:54:17.721 -> Send MLSD
13:54:18.369 -> Result start
13:54:18.369 -> Result: 150 Connecting to port 41960
13:54:18.369 -> 226-Options: -a -l
13:54:18.369 -> 226 3 matches total
13:54:18.369 -> Result end
13:54:18.369 -> type=cdir;sizd=28;modify=20230510115414;unix.mode=0755;unix.uid=20707013;unix.gid=20707013;unique=809g5bb946a1; .

13:54:18.369 -> type=pdir;sizd=73;modify=20230510115132;unix.mode=0710;unix.uid=20707013;unix.gid=48;unique=809g1a23b299; ..

13:54:18.369 -> type=file;size=18;modify=20230510115414;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g5bbbf855; helloworld.txt

13:54:18.415 ->
13:54:18.415 -> File size is: 0
13:54:18.415 -> Send TYPE
13:54:18.415 -> Type I
13:54:18.739 -> Send PASV
13:54:19.154 -> Data port: 53346
13:54:19.338 -> Data connection established
13:54:19.338 -> Send RETR
13:54:19.986 -> FTP error: 550 Can't open myPhoto.png: No such file or directory
13:54:19.986 ->
13:54:24.979 -> Send TYPE
13:54:24.979 -> FTP error: 550 Can't open myPhoto.png: No such file or directory
13:54:24.979 ->
13:54:24.979 -> Send MKD
13:54:24.979 -> FTP error: 550 Can't open myPhoto.png: No such file or directory
13:54:24.979 ->
13:54:24.979 -> Send CWD
13:54:25.026 -> FTP error: 550 Can't open myPhoto.png: No such file or directory
13:54:25.026 ->
13:54:25.026 -> Send STOR
13:54:25.026 -> FTP error: 550 Can't open myPhoto.png: No such file or directory
13:54:25.026 ->
13:54:25.026 -> Writing
13:54:25.026 -> FTP error: 550 Can't open myPhoto.png: No such file or directory
13:54:25.026 ->
13:54:25.026 -> Close File
13:54:25.026 -> Connection closed`

The File Manager of 000webhost.com showed now in my working directory /public_html/xxx :

  • helloworld.txt

With a picture program I created a pic and saved that as myPhoto.png and uploaded that file to my working directory.
I deleted helloworld.txt to avoid a message that helloworld.txt does already exist with the next run.

The File Manager of 000webhost.com showed now in my working directory /public_html/xxx :

  • myPhoto.png Size 3,0 kB Permission -rw-r--r--

After compile+upload or pressing the RST button on the cam module the Serial Monitor output now showed:
`14:04:45.171 -> Connecting Wifi...
14:04:45.635 -> ...
14:04:46.653 -> IP address: 192.168.8.100
14:04:46.653 ->
14:04:46.653 -> Max Free Heap: 110580
14:04:46.653 ->
14:04:46.653 -> Connecting to: files.000webhost.com
14:04:46.886 -> Command connected
14:04:47.301 -> Send USER
14:04:47.717 -> Send PASSWORD
14:04:48.132 -> Send SYST
14:04:48.316 -> Send CWD
14:04:48.546 -> Send TYPE
14:04:48.546 -> Type A
14:04:48.731 -> Send PASV
14:04:48.918 -> Data port: 31497
14:04:49.148 -> Data connection established
14:04:49.148 -> Send STOR
14:04:49.332 -> Write File
14:04:49.332 -> Close File
14:04:49.563 -> Send TYPE
14:04:49.563 -> Type A
14:04:49.748 -> Send PASV
14:04:50.071 -> Data port: 31264
14:04:50.211 -> Data connection established
14:04:50.211 -> Send RETR
14:04:50.488 -> Result start
14:04:50.488 -> Result: 150 Connecting to port 32720
14:04:50.488 -> 226-File successfully transferred
14:04:50.488 -> 226 0.000 seconds (measured here), 231.12 Kbytes per second
14:04:50.488 -> Result end
14:04:51.503 -> The file content is: Hi, I'm a new file
14:04:51.503 -> Send TYPE
14:04:51.503 -> Type A
14:04:51.689 -> Send PASV
14:04:52.335 -> Data port: 35494
14:04:52.475 -> Data connection established
14:04:52.475 -> Send MLSD
14:04:52.615 -> Result start
14:04:52.615 -> Result: 150 Connecting to port 52898
14:04:52.615 -> 226-Options: -a -l
14:04:52.615 -> 226 4 matches total
14:04:52.615 -> Result end
14:04:52.615 -> type=cdir;sizd=47;modify=20230510120449;unix.mode=0755;unix.uid=20707013;unix.gid=20707013;unique=809g5bb946a1; .

14:04:52.662 -> type=pdir;sizd=73;modify=20230510120121;unix.mode=0710;unix.uid=20707013;unix.gid=48;unique=809g1a23b299; ..

14:04:52.662 -> type=file;size=18;modify=20230510120449;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g479e13d0; helloworld.txt

14:04:52.662 -> type=file;size=3052;modify=20230510120202;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g479e13c5; myphoto.png

14:04:52.662 ->
14:04:52.662 -> File size is: 0
14:04:52.662 -> Send TYPE
14:04:52.662 -> Type I
14:04:53.123 -> Send PASV
14:04:53.539 -> Data port: 32317
14:04:53.677 -> Data connection established
14:04:53.677 -> Send RETR
14:04:54.368 -> Result start
14:04:54.368 -> Result: 150 Connecting to port 38409
14:04:54.368 -> 226-File successfully transferred
14:04:54.368 -> 226 0.000 seconds (measured here), 38.76 Mbytes per second
14:04:54.368 -> Result end`

The File Manager of 000webhost.com now showed in my working directory /public_html/xxx :

  • helloworld.txt
  • myPhoto.png (remark: the Contentlist shows myphoto.png, see the Serial Monitor output at 14:04:52.662)

I deleted helloworld.txt to avoid a message that helloworld.txt does exist with the next run.

Now in the sketch at line 62 I changed the filename myPhoto.png into myphoto.png and saved the sketch.

/******************************************************************************

ESP32-CAM remote image access via FTP. Take pictures with ESP32 and upload it via FTP making it accessible for the outisde network. 
Leonardo Bispo
July - 2019
https://github.com/ldab/ESP32_FTPClient

Distributed as-is; no warranty is given.

******************************************************************************/
#include "Arduino.h"
#include <WiFi.h>
#include <WiFiClient.h> 
#include <ESP32_FTPClient.h>

#define WIFI_SSID ""
#define WIFI_PASS ""

char ftp_server[] = "files.000webhost.com";
char ftp_user[]   = "";
char ftp_pass[]   = "";

ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000,2);

void setup()
{
  Serial.begin( 115200 );

  WiFi.begin( WIFI_SSID, WIFI_PASS );
  
  Serial.println("Connecting Wifi...");
  while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
  }
  Serial.println("");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  Serial.print("\nMax Free Heap: ");
  Serial.println(ESP.getMaxAllocHeap());
  Serial.println("");

  ftp.OpenConnection();

  //Change directory
  ftp.ChangeWorkDir("/public_html/xxx");

  // Create a new file to use as the download example below:
  ftp.InitFile("Type A");
  ftp.NewFile("helloworld.txt");
  ftp.Write("Hi, I'm a new file");
  ftp.CloseFile();

  //Download the text file or read it
  String response = "";
  ftp.InitFile("Type A");
  ftp.DownloadString("helloworld.txt", response);
  Serial.println("The file content is: " + response);

  // Get the file size
  const char * fileName = "myphoto.png";
  size_t       fileSize = 0;
  String       list[128];

  // Get the directory content in order to allocate buffer
  // my server response is type=file;size=18;modify=20190731140703;unix.mode=0644;unix.uid=10183013;unix.gid=10183013;unique=809g7c8e92e4; helloworld.txt
  ftp.InitFile("Type A");
  ftp.ContentList("", list);
  for( uint8_t i = 0; i < sizeof(list); i++)
  {
    uint8_t indexSize = 0;
    uint8_t indexMod  = 0;

    if(list[i].length() > 0)
    {
      list[i].toLowerCase();
      
      if( list[i].indexOf(fileName) > -1 )
      {
        indexSize = list[i].indexOf("size") + 5;
        indexMod  = list[i].indexOf("modify") - 1;

        fileSize = list[i].substring(indexSize, indexMod).toInt();
      }

      // Print the directory details
      Serial.println(list[i]);
    }
    else
      break;
  }

  // Print file size
  Serial.println("\nFile size is: " + String(fileSize));

  //Dynammically alocate buffer
  unsigned char * downloaded_file = (unsigned char *) malloc(fileSize);

  // And download the file
  ftp.InitFile("Type I");
  ftp.DownloadFile(fileName, downloaded_file, fileSize, false);

  //Create a new Directory
  ftp.InitFile("Type I");
  ftp.MakeDir("myNewDir");

  //Enter the directory
  ftp.ChangeWorkDir("/public_html/xxx/myNewDir");

  //And upload the file to the new directory
  ftp.NewFile( fileName );
  ftp.WriteData(downloaded_file, fileSize);
  ftp.CloseFile();

  free(downloaded_file);

  ftp.CloseConnection();
}

void loop()
{

}

After compile+upload the output of the Serial Monitor showed:

`14:08:19.626 -> Connecting Wifi...
14:08:20.132 -> ...
14:08:21.150 -> IP address: 192.168.8.100
14:08:21.150 ->
14:08:21.150 -> Max Free Heap: 110580
14:08:21.150 ->
14:08:21.150 -> Connecting to: files.000webhost.com
14:08:21.426 -> Command connected
14:08:21.842 -> Send USER
14:08:22.257 -> Send PASSWORD
14:08:22.535 -> Send SYST
14:08:22.766 -> Send CWD
14:08:22.950 -> Send TYPE
14:08:22.950 -> Type A
14:08:23.182 -> Send PASV
14:08:23.458 -> Data port: 36093
14:08:23.690 -> Data connection established
14:08:23.690 -> Send STOR
14:08:23.872 -> Write File
14:08:23.872 -> Close File
14:08:24.102 -> Send TYPE
14:08:24.102 -> Type A
14:08:24.378 -> Send PASV
14:08:24.610 -> Data port: 31857
14:08:24.701 -> Data connection established
14:08:24.701 -> Send RETR
14:08:24.888 -> Result start
14:08:24.888 -> Result: 150 Connecting to port 52240
14:08:24.888 -> 226-File successfully transferred
14:08:24.888 -> 226 0.000 seconds (measured here), 308.49 Kbytes per second
14:08:24.934 -> Result end
14:08:25.905 -> The file content is: Hi, I'm a new file
14:08:25.905 -> Send TYPE
14:08:25.905 -> Type A
14:08:26.229 -> Send PASV
14:08:26.739 -> Data port: 48233
14:08:26.923 -> Data connection established
14:08:26.923 -> Send MLSD
14:08:27.570 -> Result start
14:08:27.570 -> Result: 150 Connecting to port 32612
14:08:27.570 -> 226-Options: -a -l
14:08:27.570 -> 226 4 matches total
14:08:27.570 -> Result end
14:08:27.570 -> type=cdir;sizd=47;modify=20230510120823;unix.mode=0755;unix.uid=20707013;unix.gid=20707013;unique=809g5bb946a1; .

14:08:27.570 -> type=pdir;sizd=73;modify=20230510120121;unix.mode=0710;unix.uid=20707013;unix.gid=48;unique=809g1a23b299; ..

14:08:27.570 -> type=file;size=18;modify=20230510120823;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g479e13d0; helloworld.txt

14:08:27.617 -> type=file;size=3052;modify=20230510120202;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g479e13c5; myphoto.png

14:08:27.617 ->
14:08:27.617 -> File size is: 3052
14:08:27.617 -> Send TYPE
14:08:27.617 -> Type I
14:08:27.989 -> Send PASV
14:08:28.403 -> Data port: 49569
14:08:28.589 -> Data connection established
14:08:28.589 -> Send RETR
14:08:29.192 -> FTP error: 550 Can't open myphoto.png: No such file or directory
14:08:29.192 ->
14:08:34.186 -> Send TYPE
14:08:34.186 -> FTP error: 550 Can't open myphoto.png: No such file or directory
14:08:34.232 ->
14:08:34.232 -> Send MKD
14:08:34.232 -> FTP error: 550 Can't open myphoto.png: No such file or directory
14:08:34.232 ->
14:08:34.232 -> Send CWD
14:08:34.232 -> FTP error: 550 Can't open myphoto.png: No such file or directory
14:08:34.232 ->
14:08:34.232 -> Send STOR
14:08:34.232 -> FTP error: 550 Can't open myphoto.png: No such file or directory
14:08:34.232 ->
14:08:34.232 -> Writing
14:08:34.232 -> FTP error: 550 Can't open myphoto.png: No such file or directory
14:08:34.232 ->
14:08:34.232 -> Close File
14:08:34.232 -> Connection closed`

The File Manager of 000webhost.com shows in my working directory /public_html/xxx :

  • helloworld.txt
  • myPhoto.png

I deleted helloworld.txt to avoid a message that helloworld.txt does exist with the next run.

Now I changed the filename myPhoto.png into myphoto.png in my working directory /public_html/xxx

The File Manager of 000webhost.com showed in my working directory /public_html/xxx :

  • myphoto.png

After a new compile+upload (wasn't really necessary) the output of the Serial Monitor showed:

`14:11:22.750 -> Connecting Wifi...
14:11:23.260 -> ...
14:11:24.230 -> IP address: 192.168.8.100
14:11:24.230 ->
14:11:24.230 -> Max Free Heap: 110580
14:11:24.230 ->
14:11:24.230 -> Connecting to: files.000webhost.com
14:11:24.508 -> Command connected
14:11:24.924 -> Send USER
14:11:25.339 -> Send PASSWORD
14:11:25.662 -> Send SYST
14:11:25.848 -> Send CWD
14:11:26.030 -> Send TYPE
14:11:26.030 -> Type A
14:11:26.263 -> Send PASV
14:11:26.585 -> Data port: 41541
14:11:26.771 -> Data connection established
14:11:26.771 -> Send STOR
14:11:27.095 -> Write File
14:11:27.095 -> Close File
14:11:27.233 -> Send TYPE
14:11:27.233 -> Type A
14:11:27.465 -> Send PASV
14:11:27.698 -> Data port: 50764
14:11:27.883 -> Data connection established
14:11:27.883 -> Send RETR
14:11:28.113 -> Result start
14:11:28.113 -> Result: 150 Connecting to port 50672
14:11:28.113 -> 226-File successfully transferred
14:11:28.113 -> 226 0.000 seconds (measured here), 319.17 Kbytes per second
14:11:28.113 -> Result end
14:11:29.129 -> The file content is: Hi, I'm a new file
14:11:29.129 -> Send TYPE
14:11:29.129 -> Type A
14:11:29.314 -> Send PASV
14:11:29.960 -> Data port: 48046
14:11:30.142 -> Data connection established
14:11:30.142 -> Send MLSD
14:11:30.746 -> Result start
14:11:30.746 -> Result: 150 Connecting to port 53136
14:11:30.746 -> 226-Options: -a -l
14:11:30.746 -> 226 4 matches total
14:11:30.746 -> Result end
14:11:30.746 -> type=cdir;sizd=47;modify=20230510121058;unix.mode=0755;unix.uid=20707013;unix.gid=20707013;unique=809g5bb946a1; .

14:11:30.792 -> type=pdir;sizd=73;modify=20230510120121;unix.mode=0710;unix.uid=20707013;unix.gid=48;unique=809g1a23b299; ..

14:11:30.792 -> type=file;size=18;modify=20230510121127;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g5bbbf855; helloworld.txt

14:11:30.792 -> type=file;size=3052;modify=20230510120202;unix.mode=0644;unix.uid=20707013;unix.gid=20707013;unique=809g479e13c5; myphoto.png

14:11:30.792 ->
14:11:30.792 -> File size is: 3052
14:11:30.792 -> Send TYPE
14:11:30.792 -> Type I
14:11:31.166 -> Send PASV
14:11:31.581 -> Data port: 36687
14:11:31.765 -> Data connection established
14:11:31.765 -> Send RETR
14:11:32.412 -> Result start
14:11:32.412 -> Result: 150 Connecting to port 45631
14:11:32.412 -> 226-File successfully transferred
14:11:32.412 -> 226 0.000 seconds (measured here), 35.49 Mbytes per second
14:11:32.412 -> Result end
14:11:32.412 -> Send TYPE
14:11:32.412 -> Type I
14:11:33.200 -> Send PASV
14:11:33.847 -> Data port: 36088
14:11:33.985 -> Data connection established
14:11:33.985 -> Send MKD
14:11:34.354 -> Send CWD
14:11:34.769 -> Send STOR
14:11:35.137 -> Writing
14:11:35.368 -> Close File
14:11:35.553 -> Connection closed`

The File Manager of 000webhost.com now showed in my working directory /public_html/xxx :

  • myNewDir
  • helloworld.txt
  • myphoto.png

The File Manager of 000webhost.com showed in my working directory /public_html/xxx/myNewDir :

  • myphoto.png

So only when in the sketch (at line 62) the filename is written as myphoto.png and in the working directory /public_html/xxx
the file myphoto.png is found then the sketch is generating the myNewDir map and is copying the file myphoto.png in it.
To make sure I tested this sketch also with an ESP32 Dev module. Same result.

from esp32_ftpclient.

ldab avatar ldab commented on May 26, 2024

And what is the problem? on the first example you shared it prints 13:54:18.415 -> File size is: 0 therefore it is clear that the size is invalid and thus no file to download.

from esp32_ftpclient.

UNOSweeper avatar UNOSweeper commented on May 26, 2024

The problem is that I experience that the filename to be downloaded with this sketch must have a lowercase name.
You are right, I agree, at that moment there was no myPhoto.png yet in my working directory.
After that moment I had created a .png file with that name you specified in the sketch as myPhoto.png and I have saved that file into my working directory.
File size 3.0 kB
Running the sketch again, then there should be still no file (or invalid) in my working directory dat the Serial Monitor shows at 14:04:52.662 -> File size is: 0.
However, I have showed you there exists a file with the name myPhoto.png of 3.0 kB in my working directory.

The run of 14:08:27 is only meant as an intermediate step to check what the result was when the file name in the sketch at line 62 is changed into myphoto.png and myPhoto.png in my working directory hasn't yet changed into myphoto.png.
The result of that step is 14:08:27.617 -> File size is: 3052 but the sketch can't open file myphoto.png.

Only when the specified filename in the sketch at line 62 consists of only a lowercase name (I changed it into myphoto.png) and there exists a file in my working directory with the same lowercase name (I changed that as well into myphoto.png ), only then the sketch generates the myNewDir subdirectory in my working directory and downloads that file in there (the run of 14:11:22.750), as the File Manager of 000webhost.com showed me.

from esp32_ftpclient.

ldab avatar ldab commented on May 26, 2024

Aaa ok, but that is just a name mismatch that you can fix on your code. I don’t believe there is an issue with the library, so I’ll close this issue.

from esp32_ftpclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.