Split a big file to be upload using angular

Miguel Garcia Boriani picture Miguel Garcia Boriani · Jan 14, 2015 · Viewed 9.3k times · Source

I have to split a big file into 2mb parts to be sended into a server but i could not find any way. on angular or javascript. Right now i am using angularFileUpload to get it and send it as a big file. if anyone have a clue please let me know

Answer

Mihail Alexe picture Mihail Alexe · Jan 14, 2015

You have to use the HTML5 file API. More info about it you can find here. I can't provide any code example, mainly because i don't know how your server looks. You have to give the user a transaction token, and he will have to send you the chunk number, chunk data and the token, so you'll be able to re-assemble it on the server.