×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    May 2010
    Posts
    72

    MVC with FileUpload

    hello all,

    I used fileupload in ApiBridge with MVC ASP.net Applicatin


    this is code

    APIBridge.fileUpload("barcode",
    "C:\Images\myImage.jpg",
    "http://10.1.20.60:2000/Home/ReadImage",
    parameters,
    function(res) {
    document.getElementById("outer").innerHTML = "done ";
    alert("Done");
    },
    function(res) {
    document.getElementById("outer").innerHTML = "error ";
    alert("ERROR: " + res.status);
    }
    );

    my mobile can reach to the controller Home but when writing ReadImage It gives
    Error : 404

    and i ensured that ReadImage action and its view are existed so is there any suggestions


    thanks

    wael

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: MVC with FileUpload

    Hi wael,

    it seems like you're using a local IP for the upload script: are your phone and the upload server on the same LAN? Otherwise, using the public IP/hostname of your server should help.

    Pit

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

    Re: MVC with FileUpload

    hello jappit,

    I tested this link in N95 Browser and it worked well, but when I run my application that uses Fileupload method as declared below it gives me
    Error : 404 which is not found I think.
    so I saw on the emulator that putting an image in images folder in phone memory means c:\ data\ images\ [my image name]

    so I changed the code to
    [

    var parameters = null;


    APIBridge.fileUpload("barcode",
    "C:\Data\Images\qrcode.jpg",
    "http://169.254.134.242/Home/ReadBarCode",
    parameters,
    function(res) {
    document.getElementById("outer").innerHTML = "done ";
    alert("Done");
    },
    function(res) {
    document.getElementById("outer").innerHTML = "error";
    alert("ERROR: " + res.status);
    }
    );

    ]

    but still the same error

    and there is some thing that i Do not understand
    when I debug the APIBridge.js file in the library

    I found that it enters the condition of ready state in ajax which means "I think " that the application received a response (right)
    but I used sniffer program and i ensured that no request came to my pc

    so what do you think , sorry for a lot of words

    thanks for help

    wael

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: MVC with FileUpload

    Just to be sure: are you using the latest API Bridge release (v 1.1)?

    Pit

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

    Re: MVC with FileUpload

    Yes,

    APIBridge_v1_1.sis


    and actually i think when the server give me Error 404 from this code


    APIBridge.fileUpload("myimage", "C:\Images\image.jpg", "http://169.254.134.242/Home/ReadImage/",
    parameters, function(res) {
    alert("Done");
    },
    function(res) {

    alert("ERROR: " + res.status);
    }
    );

    i think the server means that it can not see my action readImage in controller home (MVC)
    Am I Right or what do you think??


    I did not have any other possibilities


    thanks,

    wael
    Last edited by phpgenerator; 2010-06-09 at 14:07.

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

    Re: MVC with FileUpload

    hello,

    I discovered that the problem when i include the image in ApiBridge code it failed

    like that
    using this line below is working so this path is true but using the code that after this line that is
    Api bridge code is failed and not showing the imagfe

    //document.write("<img src='c:\\Data\\Images\\qrcode.jpg' />");

    APIBridge.resizeImg(
    "c:\\Data\\Images\\qrcode.jpg",
    140,
    140,
    false,
    function(src) {
    document.write("<img src='" + src + "' />");
    },
    function(req) {
    alert("ERROR " + req.status);
    }
    );

Similar Threads

  1. APIBridget FileUpload
    By oldfield in forum Symbian
    Replies: 5
    Last Post: 2010-09-23, 10:05
  2. MVC
    By robinbartels in forum Symbian
    Replies: 6
    Last Post: 2009-11-09, 15:26
  3. Page Navigation in MVC pattern
    By hojatvaheb in forum Symbian
    Replies: 8
    Last Post: 2007-10-23, 16:39
  4. MVC architecture
    By msp in forum Mobile Java General
    Replies: 3
    Last Post: 2007-04-04, 08:42

Posting Permissions

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