[AC-381] Unable to upload image with titanium provided Ti.Utils.base64encode(image)
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Resolved |
| Resolution | Needs more info |
| Resolution Date | 2015-11-26T05:43:41.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Alloy, Titanium SDK & CLI |
| Labels | android, imageupload |
| Reporter | Balakrishna |
| Assignee | Mostafizur Rahman |
| Created | 2015-09-25T13:26:33.000+0000 |
| Updated | 2015-11-26T05:43:41.000+0000 |
Description
Hi All,
I am trying to upload image from gallery to server,i am selecting the image and converting the image to bytes by using the following code.
Titanium.Media.openPhotoGallery({
saveToPhotoGallery : true,
allowEditing : false,
success : function(event) {
var myBlob = event.media;
var bytes = String(Ti.Utils.base64encode(myBlob));
Ti.API.info('base64encode========='+bytes);
},
allowImageEditing : true,
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]
});
i am send this string to server through webservice but image is not uploading.
same i have done in java,both strings are coming same upto some level but java string is huge compare to titanium provided.
by passing java string through web service i am able to upload image.
please help me how to resolve this thanks in advance.
Hi , By using ArrowDB is it possible to upload gallery images to our own server
Hello [~balu], You follow this tutorial on [how to upload image to server from gellary](http://code.tutsplus.com/tutorials/titanium-mobile-build-an-image-uploader--mobile-8860). Thanks.