Is it possible to download a large file in smaller parts over ftp?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jan verschueren
    New Member
    • Jul 2010
    • 4

    Is it possible to download a large file in smaller parts over ftp?

    I was wondering if it was possible to download a large txt file from an ftp server in smaller parts.

    For example download a file of 1GB into 2 files of 500 MB.

    Is this possible without having to download 1 GB in one time?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Heya jan verschueren, welcome back to bytes.

    Short answer: Not to my knowledge.

    Long answer: It may be possible but now with FTP; It's too dump to actually manipulate files, unless of course you write your own FTP software to do this.

    Perhaps using HTTP it maybe possible.

    1. Read the file name
    2. Read fractions into one or more new file
    3. Provide links for these new files

    Then the user must put humpty dumpty back together again.

    :)


    Dan

    Comment

    • jan verschueren
      New Member
      • Jul 2010
      • 4

      #3
      Thanks for the advice.

      I will look into using http for reading the file. Building my own revolutionary ftp software is a bit out of my range :)

      If all went well, i will post the working version here. Thanks

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Strange - I thought I'd already replied to this thread.

        Anyway, file_get_conten ts allows you to specify offset and length of the file to download.

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Can you really use ftp:// with file_get_conten ts?

          I've never tried but I know http:// works.

          I'd be interested in seeing a working test script of connect to the ftp, finding the total size of file and downloading it in chunks and putting it back together.

          Anyone free and have spare time on their hands?


          Dan

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            From php.net/file-get-contents:

            Tip
            A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the List of Supported Protocols/Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.
            :)

            Comment

            Working...