Back

UploadFile

Hello World

Uploads a file to a server.

app.UploadFile( url, file, name, callback )

Example - Upload File

function OnStart()
{
    var name = app.GetAppName() + ".js";
    var file = app.GetAppPath() + "/" + name;
    app.UploadFile( "https://yourwebsite.com/upload", file, name, OnUpload );
}

function OnUpload( error, file, result )
{
    if(error) app.Alert( "Upload Failed!" )
    else app.ShowPopup( "Response:\n" + result, "Upload Successful!" );
}
Copy All       Run      
String
String: path to file ( “/absolute/...” or “relative/...” )
String: url path
function()