언어 설정

Menu
Sites
Language
How to select and post an image from gallery

Hi everyone,

I'm trying to make a form where I can select an image and post it. 

I found that : https://developer.tizen.org/forums/web-application-development/how-launch-gallery-app-and-retrieve-which-file-selected-0 ; to launch gallery and retrieve the selected image. 

Does anyone know how to get that image and post it ? I tried to look at FileReader but I need a File reference which come from the input type file. 

Thanks for your help

 

here is my code :

	var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/pick", null, "image/*");

	var appControlReplyCallback = {
	    onsuccess: function(data) {
	       for ( var i = 0; i < data.length; i++ ) {
	    	   if ( data[ i ].key == "http://tizen.org/appcontrol/data/selected" ) {
	    		   var path = data[ i ].value[ 0 ];
	    		   var itemPhoto = document.getElementById("selectedImage");
	    		   itemPhoto.setAttribute("src", path); // display image ok
	    		   // TODO : post image ...
	    	   }
	       }
	    },
	    onfailure: function() {
	       console.log('The launch application control failed');
	    }
	};

	tizen.application.launchAppControl(appControl, null,
		function() {console.log("launch application control succeed"); },
		function(e) {console.log("launch application control failed. reason: " + e.message); },
        appControlReplyCallback
	);

 

 

 

 

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 댓글
konduri sai swathi
Hi cedric , Currently input type="file" is not supported in Tizen framework . So , you can only use the method you posted for retrieving the image path and post the image . There is already bug raised : https://bugs.tizen.org/jira/browse/TWEB-111 . Follow his link for updates on this issue .