×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    15

    To get the Image path using Nokia web tools 1.2

    Hi

    I am developing the symbian app using nokia web tools 1.2 version

    In that i am using following code to get the selected image file path but i am unable to get the exact image file path
    can anyone please help me ......
    <html>
    <head>
    <script type="text/javascript">
    function GalleryCameraPopUp()
    {
    var file= document.getElementById('iFile');
    file.onchange=function(e){
    var ext = this.value.match(/\.([^\.]+)$/)[1];
    switch(ext)
    {
    case 'jpg':
    case 'bmp':
    case 'png':
    case 'tif':
    alert('allowed');
    var p;
    var canvas = document.createElement("canvas");
    var img1 = document.createElement("img");
    p=$('#iFile').val(); // i am unable to get the currect file path pleaes anyone help me with currect code
    img1.setAttribute('src', p);
    canvas.width = img1.width;
    canvas.height = img1.height;
    var ctx = canvas.getContext("2d");
    ctx.drawImage(img1,0,0);
    var dataURL = canvas.toDataURL("image/png");
    var r = dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
    break;
    default:
    alert('not allowed');


    }
    }
    </head>
    <body>
    <input type='file' onclick='GalleryCameraPopUp()' text='Browse' id='iFile'>
    </body>
    </html>

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: To get the Image path using Nokia web tools 1.2

    Note that $ is not a language element, but a conventional name for a shortcut function which of course has to be defined if you want to use it.
    Something like
    Code:
    function $(x) {return document.getElementById(x);}
    It is absolutely not sure that onclick event ever fires on a file input control, and also when it fires, you are just setting an event handler for onchange. Then later this onchange event may or may not fire. So for the first selection of a file the code probably does not provide any visual results even if it works.
    It may also be worth mentioning that HTML5 is supported by the last few Symbian models only, so it really matters what device(s) you are developing for.
    Last edited by wizard_hu_; 2013-09-03 at 15:40.

Similar Threads

  1. How to set a Image captured path in QML for Store a Image Taken Form camera
    By hari21.mca@gmail.com in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2012-06-25, 05:41
  2. How to display image (image's path is inputted by user)
    By Eagle King in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2011-05-31, 12:19
  3. How to get image path from image gallary
    By bnpawar in forum Symbian
    Replies: 6
    Last Post: 2010-11-26, 07:48
  4. S60 3rd MR: Spaces in tools path
    By jfinger in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2007-07-31, 07:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×