Unable to upload using FTP

(Aditya Rana) #1

Hi Koders,
I am trying to upload an image from my app to the server using FTP. After picking the image by image picker, I send connect command and I am connected successfully (as connection status outputs TRUE), but after using upload file block for uploading the image, It shows an empty error and image does not upload. Please Help

0 Likes

#3

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
to find out the value of Image1.Picture
Unbenannt
Taifun

1 Like

(Aditya Rana) #4

Hello @Taifun,
Thanks for replying but I already tried doing so and it shows correct path. I have now tried with simple blocks in new test project but it is still not working…
See the screenshot

0 Likes

#5

probably the FTP component needs the full path, which starts with file:///storage/emulated/0/…?
Taifun

0 Likes

(Aditya Rana) #6

@Taifun It’s still not working.
It shows error on mobile file:/storage… (no such file or directory)


Notice the difference in paths on Kodular builder and phone
On Builder, it starts with file:///
while on phone, it is only left with file:/

0 Likes

(Aditya Rana) #7

Hello @Taifun,
Is there any other way in which I can send Images to my server?

0 Likes

(Cian) #8

YOu have an extra / there

**image **

join file:// . not file:///

1 Like

(Aditya Rana) #9

Hi @cian ,
I have already tried that. That’s also not working .

0 Likes

(Philipp Lang) #10

test it in a apk and not with the companion.

0 Likes

(Aditya Rana) #11

Tried with APK also, not working

0 Likes

#12

as it already has been said, use file:///… rather than file:////
also the space in the directory could be an issue… try to upload from the root directory and in case that works, replace the spaces by %20

Taifun

0 Likes

(Boban Stojmenovic) #13

do you have file/folder permission

/Boban

0 Likes

(Cian) #14

I have FTP working fine. I pic an image, upload it. If it uploads OK a button shows up. Click the button, it will download it and show the image.

Here is an AIA with it fully working.

list.aia (2.8 KB)

0 Likes

(Aditya Rana) #15

Sorry @cian,
Your I compiled your AIA to APK but it’s not working.
Can it be problem on device?
I have Oppo A3s running Android Oreo.

0 Likes

(Cian) #16

Nope, I just tried it again on companion and it works. What is not working?

Read the blocks and see where all the notices get posted. What error is it.

0 Likes

(Aditya Rana) #17

Is Anything uploaded on your server. I have tried uploading many images. I am not getting Upload done alert.
And I have added On Upload Error block to get the error message in you list AIA, the app shows empty error.

0 Likes

(Cian) #18

Mate my Aia works with no changes loom at the blocks.

Just use my Aia and go fro there I tried it just now and it worked

0 Likes

(Aditya Rana) #19

I have also tried it without any changes, is there any change in files on your server.

0 Likes

(Boban Stojmenovic) #20

Either it is a bug in the FTP component or that it doesn’t work well with all android version as it should

/Boban

0 Likes

(Aditya Rana) #21

Hello @Boban,
Is FTP working for you?
Have you tried ?

0 Likes