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


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!!


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 ?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JamesFrogAuthor Commented:
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?


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.
JamesFrogAuthor Commented:
Thanks for your help. This was very useful for me.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
File Sharing Software

From novice to tech pro — start learning today.