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

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya