0
votes

I am writing a Java app that uploads image and video files to a server side script. So far I've got the image upload happening using HTTPURLConnection/DataOutputstream and it seems that I might be able re-use a good deal of the code I've written to also upload the video. My question is, where the following snippet declares that the Content-Type is "image/jpeg" for images, what Content-Type should be use used for video files?

output.writeBytes("Content-Disposition: form-data; filename=\"filename\" \r\nContent-Type: image/jpeg\r\nContent-Transfer-Encoding: binary\r\n\r\n");

Thanks in advance!

1

1 Answers

1
votes

What type is the video? You should be able to choose a specific Mime Type for the video in question.

See Internet Media Type at WikiPedia and also the IANA registry for video mime types