UploadFile

106 views
Skip to first unread message

Anna Roleffes

unread,
Mar 7, 2017, 9:11:55 PM3/7/17
to DroidScript
how do i the function UploadFile

Steve Garman

unread,
Mar 8, 2017, 5:10:20 AM3/8/17
to DroidScript
It is intended to upload files to a url that is designed to accept an upload.
app.UploadFile( url,file,name,callback );

"file" is the whole path to a file on your device.

"name" is the name to be used for the file on the server.

"callback" is a function to be called when the upload is complete.

If you need more help, you should post full information about where you are trying to upload to and what you do not understand.

Jugador Player

unread,
Jul 17, 2021, 1:17:49 PM7/17/21
to DroidScript
Hello, i was looking for information about uploadfile and trying to work with this, but no work.
How work exactly?
How work server side? .. i try this if (isset($_POST['submit'])) {
but no wotk..
some one can help?

Steve Garman

unread,
Jul 17, 2021, 1:42:21 PM7/17/21
to DroidScript
I apologise Justin

I sent you a direct email by mistake

Steve

Alan Hendry

unread,
Jul 21, 2021, 10:17:41 AM7/21/21
to DroidScript
HI,
There's an example in the reference in the DS app or see https://symdstools.github.io/Docs/docs/app/UploadFile.htm
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!" );
}
Regards, ah

Steve Garman

unread,
Jul 21, 2021, 10:54:26 AM7/21/21
to DroidScript
The original question was in 2017 and the original poster seemed satisfied by my sketchy reply inviting feedback with any problems

Justin's much more recent post was asking about server-side code
I sent him some php form code that works for me. 
I'm sure he'll ask again if he needs more information
Reply all
Reply to author
Forward
0 new messages