How to split and upload a very large file and rejoin on the server using FTP in Mac OS X terminal

Posted on 2008-11-09
Last Modified: 2013-12-09

I have a 400MB flv (flash video file) that I want to upload to my webspace. If I tried to upload in one go, the server keeps timing out.

What I want to do is this:

1) Split the file into 100MB chunks and upload each of them
2) Then rejoin them on the server (from the Mac OS X terminal) so that the original flv file is restored

I have currently been trying this:

At the terminal:

split -b 100m "video.flv" video
(which runs fine)

... I them upload the 100MB files to the server and then from the terminal type....

cat videoab >> videoaa
cat videoaa >> videoaa


But my Terminal does this:

ftp> cat videoab >> videoaa
? Invalid command

How do I do this so that it works? (I'm not sure if the server is running unix)

I have heard of 'append' which seems to be a recognised command on the server - but how do I use this is this can be used to join all the files together.

Please help,

I just need a way to split my video file, upload the segments, then rejoin the video file on the server.

Thanks - I'm waiting for your expertise!!


Question by:JamesFrog
    LVL 8

    Accepted Solution

    First major problem is that you are trying to concatenate the files uploaded on the remote server using the ftp> prompt.  FTP is not a terminal interface into the remote server and doesn't have the cat command.

    There are many ways to accomplish what you want to do and here might be two of them :

    1) use the 'append' command within FTP to upload the first part then append the following parts, in order.  Type 'help' at the ftp command prompt for some more information.  Note: I've never used this functionality myself so I can't say how well it does or does not work.  Sounds good though and it could be a convenient solution to your problem.
    2) upload all your files then login using something like SSH to get a command prompt and manipulate the files any way you want.
    3) remotely execute some batch program to fetch the files from your server and combine them on the other side.

    Finally, I would look into why the server times out.  That 2 me is your real problem.  Fix that and you don't have to deal with splitting, recombining, etc, right ?

    Author Comment

    Thanks for you comments - I agree 3) is probably what needs to be sorted.

    I'm going to try 1).

    Could I just ask - how should the files be split in the first place for append to work?

    Would the files resulting from

    split -b 100m "video.flv" video

    be 'appended' back into the original flv file?


    LVL 8

    Expert Comment

    I haven't used the append command but, the documentation says that it would work the same as cat. - Just make sure you are transfering in binary.

    I wold try an experiment :  

    1) Pick some small file 5Meg or so
    2) run some cksum on it
    3) 'split' it into two files
    4) ftp using append
    5) run cksum on the remote computer

    OR if you can't get a remote terminal then just use ftp to pull the transfered file back and run cksum on it locally

    Giood Luck,
    HOpe it helps.

    Author Closing Comment

    Thanks for your help. This was very useful for me.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Deploystudio is a system which can be used to deploy OSX clients and servers within the small/medium or large business environments. The system is built ontop of the OSX Server NetBoot system and uses images & workflows as its core assets. Although …
    Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now