iOS Question Upload File to server Error File doesn´t exist

Humberto

Active Member
Licensed User
Longtime User
I´m trying to upload a text file for a test and I get this error as the file doesn´t exist, so I test first if the file exist. I put also at filetab

B4X:
Sub bt_file_Click
    job_evento.Initialize ("Job_File", Me )

    If File.Exists ( File.DirAssets, "teste.txt" ) Then
        Dim File_List As List
        File_List.Initialize
        Dim fd As MultipartFileData
        fd.Initialize
        fd.Dir = File.DirAssets
        fd.FileName = "texte.txt"
        fd.KeyName = "upfile"
        fd.ContentType = "text/plain"
        File_List.Add(fd)
        job_evento.PostMultipart("http://www.xxxxxxxx/upload.php", CreateMap("Key1": "Value1", "Key2": "Value2"), File_List)
    Else
        Msgbox ( "File doesn´t exist", "error")
    End If
End Sub

 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…