how to split a file in chunk in IOS or Javascript