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
Medium Priority
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
  • 2
  • 2

Accepted Solution

97WideGlide earned 2000 total points
ID: 22917321
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

ID: 22917371
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?



Expert Comment

ID: 22917418
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

ID: 31514856
Thanks for your help. This was very useful for me.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
Many of the companies I’ve worked with have embraced cloud solutions due to their desire to “get out of the datacenter business.” The ability to achieve better security and availability, and the speed with which they are able to deploy, is far grea…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), 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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

807 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