views:

237

answers:

1

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\n*Content-Type: image/jpeg\r\n*Content-Transfer-Encoding: binary\r\n\r\n");

Thanks in advance!

+1  A: 

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

Kevin
Good question.. it's a quicktime file (.mov).
jeremynealbrown