Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-686

Most files aren't downloaded completely from an FTP server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 3.6, 3.7.2
    • None
    • FTP
    • None
    • Win 10

      Java 8

      Android Studio 3.6.1 (min SDK 24, target SDK 27)

    Description

      About a month ago I opened another issue that was closed because it wasn't reproducible with macOS and a public FTP server.

      Short summary: Downloading files from an FTP server results in these files randomly missing bytes. It looks like the download always "completes" and there are no error messages/exceptions but random bytes in random files are simply skipped. Images (jpg & png) are usually affected more (up to 30, maybe 40, bytes smaller than the original), and are then also visibly corrupt, than text files (usually only 2-3 bytes smaller, rarely more).

      I'm working on an Android app (Win 10, Java 8, Android Studio 3.6.1, min SDK 24, target SDK 27), which I'm testing with FTP servers in the same network (1x Win 10, 1x Linux, both accessed via IP - "10.1.1.xxx"). No matter what method in the library I use (retrieveFile, retrieveFileStream, sendCommand(FTPCmd.RETRIEVE, filename)), most of the time there's at least a single file that's corrupted.

      I also tested the same code with public servers and even though I didn't have a lot of time because those servers regularely delete uploaded files, I never experienced said problem with them.

      I even wrote my own mini-library (just for login/logout and download) using Java's default "Socket" but I still had the same problem on Android Studio's simulator/a real device. BUT: When I used the same code to create a small Windows/Swing/Java app, there were no more corrupted files.

      It looks like this bug is only affecting a very specific combination of OS,...:

      Android (emulator/real device) + Java (8) + FTP server in the same network (accessed via IP)

      Attachments

        1. DownloadProblem.java
          3 kB
          JRRR
        2. 5c-corrupt.jpg
          3.89 MB
          JRRR
        3. 5b-corrupt.jpg
          3.89 MB
          JRRR
        4. 5a-original.jpg
          3.89 MB
          JRRR
        5. 2c-corrupt.png
          445 kB
          JRRR
        6. 2b-corrupt.png
          445 kB
          JRRR
        7. 2a-original.png
          445 kB
          JRRR

        Activity

          People

            Unassigned Unassigned
            JRRR JRRR
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: