iOS Question FTP stops working after first successful upload

Vern

Member
Licensed User
Longtime User
I've been trying to upload 3 files using FTP (iNet 1.2) and no matter what, it only uploads the first file and not the other two. This code works fine in my Android app. If I comment out the FTP code for the first file, the second file uploads but not the third, and so on. Here's the code for uploading the first file:

If File.Exists(filepath, filename) Then
ftp_dest = "/public_html/uploads/" & filename
FTP.UploadFile(filepath, filename, False, ftp_dest)
Log(ftp_dest)
Else
Msgbox("No data to upload (file not found)", "Error")
End If

After seeing this post: https://www.b4x.com/android/forum/threads/ftp-works-only-for-the-first-file.48343/#post-300615
I realize I'm having the same problem. How can I get FTP to work on my iPhone?
 

Vern

Member
Licensed User
Longtime User
Yes, I am handling the UploadCompleted event. There is no exception and no error message. It looks like everything works, but it doesn't. It appears that all FTP commands (after the first one successfully executes) are being ignored.
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Guys

FTP_UploadProgress, event is not triggered, while FTP_UploadCompleted is working ok.

I would like to know if there is a solution, or at least if I can monitor the upload status to make sure it is still going
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
there is no UploadProgress event in B4i for FTP.

Jan, thanks for your reply.
Then, how do I know that an upload is taking place or in progress?

Say you are uploading different size files. Sometimes a 1K file other times 30MB file. How do I know how long to wait for the process (in case things go wrong and I don't get UploadCompleted event)?, or how do I show the user a progress status as indication of how long they should wait for the process to complete?

Thanks again
 
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,
How do I know how long to wait for the process
For now it's not possible to calculate the time for the process.

in case things go wrong and I don't get UploadCompleted event
The UploadCompleted event is always called, to know wheter the upload failed check the Success parameter.

The best solution is to show a progress indicator when you start the upload and hide it in the UploadCompleted event.

Jan
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
Thanks Jan for the advise.
I am already doing it this way. The only thing I don't like about it, is that there is no indication for the user about the estimated time ( or the progress in general)

Thanks again
 
Upvote 0
Top