iOS Question FTP work fine first time

Discussion in 'iOS Questions' started by MarcoRome, Apr 29, 2018.

  1. MarcoRome

    MarcoRome Expert Licensed User

    Hi all, i have this code:

    Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)

    If Success Then
            filenameresize = 
    "foto" & DateTime.Now
    '******Save picture and trasfert via FTP
            Dim Out As OutputStream
            Out = 
    File.OpenOutput(File.DirTemp, filenameresize & ".jpeg"False)
    Image.WriteToStream(Out, 100"JPEG")
            img_photo.Bitmap = 
    LoadBitmap(File.DirTemp,filenameresize & ".jpeg")
    'ftp was previously initialized And its event name was set To ftp:
            ftp.Initialize("FTP"""21, usr_ftp, pw_ftp)
    ftp.PassiveMode = True
    ftp.UploadFile(File.DirTemp, filenameresize & ".jpeg"False"/" & filenameresize&".jpeg")
    Log("Non selezionato")       
    End If
    End Sub

    Sub FTP_UploadCompleted (ServerPath As String, Success As Boolean)
    Log(ServerPath & ", Success=" & Success)
    If Success = False Then
    "Foto copiata sul server ",2000)
    End If
    End Sub
    Work fine the first time, after if i select new file, the event FTP_UploadCompleted ISNT fired
    Any idea ?
    Thank you
  2. Erel

    Erel Administrator Staff Member Licensed User

    Initialize FTP once when the program starts.
  3. MarcoRome

    MarcoRome Expert Licensed User

    Hi Erel, already do but dont change nothing
  4. Erel

    Erel Administrator Staff Member Licensed User

    Hard to say. Try to close it after each transfer and then initialize it again.

    If it doesn't work then you can send me a small project and I'll try it here.
    MarcoRome likes this.
  5. chardenal

    chardenal Member Licensed User


    I have exactly the same problem, works fine the first time but nothing after for the second file to upload...
  6. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice