0

I'm trying to upload video with Volley using a POST request but i don't know how create the stream of byte of a .mp4 video saved on my Android phone. Can someone help me?

Thank you.

ruspa
  • 3
  • 1
  • 5

1 Answers1

1

Your approach is not the good one, I'd say. It could work but there are much simpler ways: why don't use a File and upload it to your server as a multipart/form request for instance: this answer is really good in this way.

It could be that it's not gonna work with big files and you won't be able to add a progress bar with this option.

I'm a big fan of Volley but it is pretty obvious that it hasn't been design for heavy file transfers and is focused on consuming a simple REST/JSON API. Therefore, I would recommend to switch library to something designed for your needs like this one (Android Async). It is, to me, much better FOR THAT PURPOSE (and if you need a webserver too!)

Hope it helps

Community
  • 1
  • 1
Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57