Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User rondoguo's Avatar
    Join Date
    Aug 2010
    Posts
    5
    Hi all,
    I reference this http://www.jappit.com/blog/2010/02/0...ing-apibridge/ to write a widget that first take a photo ,and then upload it to the server.
    My code is:
    function init(){
    function photoCaptureSuccess(photoSource){
    if (photoSource && photoSource.length) {
    document.getElementById('captured_photo').src = photoSource;
    APIBridge.fileUpload(
    "photo",
    photoSource,
    "http:xxx.php",
    null,
    function(res) {
    alert("Done");
    },
    function(res) {
    alert("fileUpload ERROR: " + res.status);
    }
    );
    }
    else {
    alert("No image taken...");
    }
    };

    function photoCaptureError(ajaxReq){
    alert("Error " + ajaxReq.status);
    };

    function takePhoto(){
    APIBridge.newFileService(APIBridge.NewFileType.Image, photoCaptureSuccess, photoCaptureError);
    }
    document.getElementById('capture_button').addEventListener('click', takePhoto, false);
    }

    The Problem is : Only once can I uoload a photo ,the second time it failed with ERROR: 500.
    But when I restart my device(N97) or reinstall the sis file ,It can upload a photo again(but ony once ) .
    Any one knows how to solve the problem?
    Thanks very much

  2. #2
    Registered User jzferreira's Avatar
    Join Date
    Sep 2008
    Location
    Manaus, Brazil
    Posts
    109
    ERROR 500, it's mean an internal error in the server.
    Javier Zambrano Ferreira

Similar Threads

  1. APIBridge
    By pcardoso in forum Symbian Web Runtime
    Replies: 4
    Last Post: 2010-09-22, 11:58
  2. The Problem of APIBridge
    By rondoguo in forum Symbian Web Runtime
    Replies: 0
    Last Post: 2010-08-12, 02:30
  3. APIBridge plug-in and Camera
    By prog.ahmedsamir in forum Symbian Web Runtime
    Replies: 2
    Last Post: 2010-04-15, 11:05
  4. Publishing widgets with APIBridge
    By powerpixels in forum [Closed] Publishing to Nokia Store
    Replies: 1
    Last Post: 2010-01-26, 23:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved