- Home /
How to Convert MovieTexture to Byte?
In my project at school, I need to load an .ogg file from a local file system then upload it into a web server. But, base on samples on the net, I guess before I can upload the MovieTexture file, first I need to convert it into byte. So my question is how to convert MovieTexture to Byte?
Btw, I already google the issue, but can't find an answer so far. Any help will be appreciated.
Thanks.
Answer by Statement · Mar 03, 2011 at 02:28 PM
If you're happy to just load the file with System.IO:
var bytes = System.IO.File.ReadAllBytes("file.ogg");
Alternatively, use the WWW class. It has a bytes member you can get the bytes from.
Otherwise I don't know how to get the bytes of a MovieTexture.
Damn me! I forgot about .bytes X) Well I really need the .progress in WWW class so I don't want the System.IO solution. I think I can make this works now. Thanks for the help:)
Your answer
![](https://koobas.hobune.stream/wayback/20220613111151im_/https://answers.unity.com/themes/thub/images/avi.jpg)