I'm using a restful webservice developed in php. The webservice will send data images. For images it will send the image name and we will prepare the url of the image on fly to download it. But now there is a requirement to download video files. We can follow the same way like downloading images (ex: image name = "myimage1.jpeg" url=www.xyz.com/images/myimage1.jpeg", we will read this directly and create file locally), but want to know is there any way from php to send the data like binary string from php and convert it into movie file at Android end.
(Can we send images as json data from php webservice. Please give some code)
Note: How to send Images/Videos files from restful webservice as json data
As ChriZzZ stated, it's inadvisable (and not really natively supported) in JSON.
However, you may consider using BSON (Binary JSON). Specifically for a PHP implementation, the site provides a link to Mongo, so you may want to check that out. Unfortunately, I have no code to provide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With