This blog will help you in recording and uploading video to server using multiparts in iPhone.
We have two methods for sending video data to server:-
1. Video data is encoded before sending data to server.
2. Video data is encoded after receiving complete data to server.
We can encode video data before sending data to server, but at the same time we have some drawbacks like time issues, lagging effects. Thats why we have preferred the second option, where we are recording the video and send video data to server using “multipart”. When data successfully received at server side, then encoding part would be done on server side only. This method will prevent the app from time and lagging effects.
In the case of multiple part messages, in which one or more different sets of data are combined in a single body, a “multipart” Content-Type field must appear in the entity’s header. The body must then contain one or more “body parts,” each preceded by an encapsulation boundary, and the last one followed by a closing boundary. Each part starts with an encapsulation boundary, and then contains a body part consisting of header area, a blank line, and a body area.