yagiz23:
::::SNIP::::
Is there a way of uploading the base64 text directly to Firebase from the linux environment and/or reading the entire text file as a single string in the arudino environment?
Thank you
@yagiz23,
I guess people were not clear on this. Forget about the "String()" thing. The base64 utility converts the entire file in ONE pass so there is no need to make it strings. And to be clear, firebase can handle the entire file just as long as you give the data in the correct fashion.
To be extra clear, firebase does want all it's data in strings, but it does NOT care how long the string is because anything over 10Megabytes gets truncated. Lastly, I do not expect any single image you have to be larger that 10megabytes. In the worst possible case we will split a file into pieces, if needed.
So, let's just accomplish the task.
Google: firebase store file
The first link explains (in abstract) what you need to do and the limitations.
In the end, you'll need to use the firebase REST API to store your images(files). In your case you'll want to use PUT, not POST in your API call. You can use POST, but then you'll need to remember the key the return to you after every API call. We'll skip that for now.
On the Linux side, SonnyYu gave you most of the instructions, see post #4. After you have converted the jpeg image to a text file, you just upload it to firebase using curl.
So the next step is to use CURL.
Generically, here is you call:
$ curl -X PUT -d @<filename_of_base64text> https://.firebase.io.com/images/.json
At this point, all you need to do is replace the items in between the angle brackets "<>".
START NEW
Okay. One problem, that even I forgot, is that firebase wants to see everything as JSON. That means you will need to modify the base64 file. Basically double quote the label and the value and wrap it in curly braces. Like this:
{"image":"iVBORw0KGgoAAAA....kJggg=="}
I'm sorry I forgot to mention this earlier. I've been bouncing back and forth between, the YUN, my blog and phonegap stuff.... I just forgot this. Sorry again.
END NEW
I hope this is clear. If not, please ask more questions.
Okay. I made a mistake here. I'll get you the correct call in a bit. 8:15pm local time
Okay, I've added new information that should fix the problem. 8:55pm
Jesse