I am using React Native and Expo to develop an app to control the camera via Client Mode. So with this Client Mode, every call needs to have digest authentication, otherwise, the call will fail.
When I fetch the data using react-native-digest-fetch, I can get the data from the camera.
The thumbnail in camera.listFiles is base64. However, the image is normally a stream of bytes. Though, it depends on your library that you’re using for the HTTP request and response.
In Client Mode, I haven’t found a way to write the data into a file. Is there a way to shut down the digest authentication with Ricoh Theta X? Fetching without the digest would be much more easier. Then I can use the Download Async function to get the job done.
I finally managed to fetch with Digest Auth and write the data into a file. Thanks a lot for your help.
The data is actually not base64 so it requires some extra steps using FileReader to parse the data and delete some unnecessary part of the data before can actually write into the file.
Is the image file data from the camera different when using Client Mode versus Access Point mode? Are you using react-native-digest-fetch for both the AP and Client Mode HTTP requests?
I thought that both are just a URL endpoint that can download the image using an HTTP GET command. I thought that in both cases, the data is a stream of bytes.
Though, it may depend on how you are making the HTTP request. In my example with dart, there is an option on the response to treat the response as bytes, not as a string. The default for the library I am using is to return the response as a string.