×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Perth, Western Australia
    Posts
    286

    APIBridget FileUpload

    Hi,
    I am having a little trouble with the APIBridge FileUpload. I am certain it is a silly problem but does anyone know wehat I am doing wrong?

    Trying APIBridge fileupload; I call

    function onFileUploadClicked() {
    clearOutput();

    var file = document.getElementById("uploadfilename").value;
    var url = document.getElementById("uploadfileserverurl").value;
    var output = document.getElementById("output");

    APIBridge.fileUpload(
    "",
    file,
    url,
    null,
    function(res) {
    output.innerHTML = "RESPONSE: " + res.status + ";" + res.statusText + ";" + res.responseText;
    },
    function(res) {
    output.innerHTML = "ERROR: " + res.status + ";" + res.statusText;
    }
    );
    }



    As per example, with the URL being

    http://d4072.mysite.westnethosting.c...fileupload.php




    and the fileloader.php is

    <?php
    // full path of the media folder to upload medias to
    $content_dir = "PersonalImages/";
    // media filename
    $filename = $_FILES["fileName"]['name'];
    // move from /tmp to content dir
    move_uploaded_file($_FILES['fileName']['tmp_name'],$content_dir.$filename);
    ?>



    Now it returns 200 and OK so it is working, however the image does not appear in the personal Image folder. What am I doing wrong?

    Regards
    Brian Oldfield

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: APIBridget FileUpload

    Hi oldfield,

    Just checking if you can verify does the first fileUpload parameter of your code contain the actual binary data of the uploaded file?

    ...comparing this
    APIBridge.fileUpload("", file, url, null, ...etc

    to this...

    APIBridge.fileUpload("image", "C:\Images\test.jpg",
    "http://www.test.com/fileupload.php",
    parameters,..etc


    Cheers,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  3. #3
    Regular Contributor
    Join Date
    May 2010
    Posts
    72

    Re: APIBridget FileUpload

    hello,


    I think you should write "name" in the first parameter instead of ""
    in fileupload

    I hope i answered your question



    wael

  4. #4
    Registered User
    Join Date
    Dec 2009
    Posts
    6

    Re: APIBridget FileUpload

    I'm trying to upload file but I can't undersatnd what is the fileupload.php file....
    Is it possible with this file to get the image file from my nokia device and upload it to some Internet server or other options that allow me to get binary data of the image and pass it to some backend system?

    Can you please send me the full example (including html and java script and other required sources).

    Thanks a lot!

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    1

    Re: APIBridget FileUpload

    thanks for that information..

  6. #6
    Registered User
    Join Date
    Jun 2010
    Posts
    7

    Re: APIBridget FileUpload

    In my case the error function is called. With the error status 404. I assume that means "not found", but I'm sure my url is correct...
    Any ideas?

Posting Permissions

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