Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7904421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:03:41+00:00 2026-06-03T10:03:41+00:00

I have a very simple app where the user selects an image from the

  • 0

I have a very simple app where the user selects an image from the iOS photo gallery.

The TIBlob passed to Titanium.Media.openPhotoGallery.success event is then passed to an application-level event.

The issue is that the TIBlob is NULL when the application level event is received.

Below is a complete code sample.

Titanium.UI.setBackgroundColor('#000');

var win = Ti.UI.createWindow({title: 'Camera Test', exitOnClose: true, fullscreen: true, backgroundColor: '#ffffff'});

var bt = Ti.UI.createButton({'title': 'Gallery', top: 10, width: 200, height: 50});
bt.addEventListener('click', function(e) {
    Titanium.Media.openPhotoGallery({
            success:function(event) {   
                if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
                    alert(event.media);
                    Ti.App.fireEvent('uploadImage', {image: event.media, source: 'gallery'});
                }else {
                    alert('Image was not uploaded because the type was invalid.');
                }
            },
            cancel:function() {
            },
            error:function(err) {
                alert('Error selecting image from gallery: ' + err);
                Ti.API.error(err);
            },
            allowEditing: false,
            autohide: true,
            mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
      });
});

Ti.App.addEventListener('uploadImage', function(e) {
    alert(e.image);
    alert(e.source);
});

win.add(bt);
win.open();

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:03:42+00:00Added an answer on June 3, 2026 at 10:03 am

    The Appcelerator Guides say that objects passed through and event must be JSON-serializable https://wiki.appcelerator.org/display/guides/Event+Handling#EventHandling-Firingevents. A TiBlob is not serializable, so I think the blog is not making it through the event.

    If this really is a very simple app, I would suggest changing that to a function call instead of firing an event and the blob will be preserved. However, if this absolutely needs to be an event, you could pass event.media.nativePath instead and then read a blob out of that when you actually need to do something with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple iPhone app that requires a random integer from 1-100.
I have lately been developing a very simple app for iOS with PhoneGap. All
I have a very simple ruby rack app which retrieves information from a webservice
I have a very simple online ordering app in Perl. The user fills in
I have a very simple webforms app that will allow field techs to order
I have a very simple OpenRasta app with a Home resource with a single
I have a very simple Rails app with a very simple relational database: Category
Deploying on JBoss AS 7.1.0.Final. I have a very simple test app. It was
I have a very simple Mac Cocoa app that just has a Web View
I have a very simple dialog defined as: import android.app.AlertDialog; import android.content.Context; import android.view.LayoutInflater;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.