I am working on a Android project and want to upload Bitmap images to my rails server. But I have no idea how to write the Rails models or controllers.
I find someone using MultipartEntity post to upload images and paperc开发者_如何学Golip to recieve images on RoR server. I want to know how to connect the post and server (what url?) and how to write the model or controller.
I use a stupid method. I convert the Bitmap image to byte array and use Base64 method to convert it to a string. Post the string to server. When I want to get image, download the string and convert it to Bitmap.
精彩评论