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

Application_Start
The default app has not been configured yet.
Configuring the default app.
Application_Active
(empty string)
Application_Pushtoken
Application_Pushtoken
FCMConnected
Error occurred on line: 471 (Main)
Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
Push -[B4IFile OpenInput::] + 508
Push -[b4i_httpjob _postmultipart:::] + 4174
Push -[b4i_main _bt_file_click] + 3024
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 292
Push +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
Push -[B4IShell runMethod:] + 574
Push -[B4IShell raiseEventImpl:method:args::] + 2212
Push -[B4IShellBI raiseEvent:event:params:] + 1442
Push __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib <redacted> + 1524
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1574
CoreFoundation CFRunLoopRunSpecific + 520
CoreFoundation CFRunLoopRunInMode + 108
GraphicsServices GSEventRunModal + 160
UIKit UIApplicationMain + 144
Push main + 106
libdyld.dylib <redacted> + 2
)
 
Last edited:
Top