Titanium JIRA Archive
Appcelerator Community (AC)

[AC-381] Unable to upload image with titanium provided Ti.Utils.base64encode(image)

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2015-11-26T05:43:41.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
Labelsandroid, imageupload
ReporterBalakrishna
AssigneeMostafizur Rahman
Created2015-09-25T13:26:33.000+0000
Updated2015-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.

Comments

  1. Balakrishna 2015-09-26

    Hi , By using ArrowDB is it possible to upload gallery images to our own server
  2. Sharif AbuDarda 2015-11-23

    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.

JSON Source