not able to save file in server

not able to save file in server

Hi Team,

i am very new to the intel XDK. but i liked it very much, kudos to you guys..
my problem is i am able to take picture and show it in my app but not able to save it.
i have googled it and found below code but when i am running the same in debugger its showing me access problem.

function uploadtoserver()
{
var pictureURL=intel.xdk.camera.getPictureURL(pictureFilename);
alert(pictureURL);
intel.xdk.file.uploadToServer( "http://localhost:58888/"+pictureURL,"http://192.168.1.101/Save_Picture.aspx/UploadPic", "", "image/jpeg", "updateUploadProgress");

function updateUploadProgress(bytesSent,totalBytes)
{
if(totalBytes>0)
currentProgress=(bytesSent/totalBytes)*100;
document.getElementById("progress").innerHTML=currentProgress+"%";
}

document.addEventListener("intel.xdk.file.upload.busy",uploadBusy);
document.addEventListener("intel.xdk.file.upload",uploadComplete);
document.addEventListener("intel.xdk.file.upload.cancel",uploadCancelled);

function uploadBusy(evt)
{
alert("Sorry, a file is already being uploaded");
}

function uploadComplete(evt)
{
if(evt.success==true)
{
alert("File "+evt.localURL+" was uploaded");
}
else {
alert("Error uploading file "+evt.message);
}
}

function uploadCancelled(evt)
{
alert("File upload was cancelled "+evt.localURL);
}
}

could you please help me on the same. (either send me some working code or correct my code)

quick reply will be much appreciated.

Regards,
Pranay Joshi

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Search for PhoneGap examples for the various ways to do this. The XDK provides you with a container that is similar to a PhoneGap or Cordova container and the techniques used for those hybrid apps also apply here.

Hi Pranay,

Did you get a clear solution to this, I'm stuck in the same problem. Please hep if you can

Leave a Comment

Please sign in to add a comment. Not a member? Join today