开发者

Using Java To Upload Video via PUT

开发者 https://www.devze.com 2022-12-19 05:54 出处:网络
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 ab

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\nConte开发者_高级运维nt-Type: image/jpeg\r\nContent-Transfer-Encoding: binary\r\n\r\n");

Thanks in advance!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消