I don't know what you are trying to do with this servlet, but there are a few things I noticed.
1) There is so much unused code in this servlet. The json strings that you are trying creating in your servlet are not being used at all. Did you notice that ? The file name or tokens or whatever is present in the json
string has no effect at all. ( Another thing regarding json, Use some open source json api instead of creating json strings yourself. Creating it by hand would be vulnerable to bugs.)
2) I dont know why you dont get a MalformedURLException when you are trying to create a new Url on line 201 ??!! Also the targetURL2 and targetURL3 are never used.
The only thing that seems okay about the code is the part where you are trying to get an input stream and writing it out using bytearrayoutpoutstream. It seems that you have blindly copied code and trying to make it work without understanding it. Please try to understand what you want in your program and what you want to achieve.
And the video file name is getting through probably because of the code on line 110. not sure.