B4A Library Automated FTP Library

dcfax

New Member
Licensed User
Longtime User
error if no "*" in filenames for FTP.UpLoadFile ?

i can't use the uploadfileset with a simple list of files without "*" in the file names

when i try :

FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA*.jpg", "/mnt/sdcard/backups/contact*.dat"), False)

ok, everythingis working good

but when i try something like

FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA52.jpg", "/mnt/sdcard/backups/contact01.dat"), False)

i am getting an error :
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at ftp.auto.ftp_auto._vv1(ftp_auto.java:243)
at ftp.auto.ftp_auto._vvvvvv0(ftp_auto.java:1518)
at forver.dvd.main._button1_click(main.java:393)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63)
at android.view.View.performClick(View.java:4147)
at android.view.View$PerformClick.run(View.java:17161)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4788)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1


and a few more testing show me that a get the same error while trying to put the "*" in the file extension :

FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA0001.*pg"), False)

an idea ?
 
Last edited:

dealsmonkey

Active Member
Licensed User
Longtime User
Hi great library.

I am able to upload to my ftp server no problem, however when I call the makedir command, I get the following error on the device. Any thought please, I am using version 1.02

B4X:
ftpauto.MakeDir("jobs")
java.lang.NoSuchMethodError: anywheresoftware.b4a.net.FTPWrapper.SendCommand

    at ftp.auto.ftp_auto._vvvv2(ftp_auto.java:1150)
    at com.nejo.c2dm.frajobentry._uploadftp(frajobentry.java:3215)
    at com.nejo.c2dm.frajobentry._btnsync_click(frajobentry.java:901)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63)
    at android.view.View.performClick(View.java:4204)
    at android.view.View$PerformClick.run(View.java:17355)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5041)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (frastartactivity) Create, isFirst = true **
 

dealsmonkey

Active Member
Licensed User
Longtime User
I have gone back and looked at the library code. I do not see anything that should cause this issue. What device are you using and what OS version is it running?

Hi Margret,

Using a Nexus 7 16Gb with OS 4.2.2

I will try the command on an "empty" project tomorrow and see if it still exists..
 

dealsmonkey

Active Member
Licensed User
Longtime User
Hi Margret,

tried with passive = true and false and also a clean project. still get the error :

B4X:
aftp.MakeDir("new")
java.lang.NoSuchMethodError: anywheresoftware.b4a.net.FTPWrapper.SendCommand

    at ftp.auto.ftp_auto._vvvv2(ftp_auto.java:1150)
    at b4a.example.main._activity_create(main.java:249)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
    at b4a.example.main.afterFirstLayout(main.java:89)
    at b4a.example.main.access$100(main.java:16)
    at b4a.example.main$WaitForLayout.run(main.java:74)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5041)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    at dalvik.system.NativeStart.main(Native Method)
 

dealsmonkey

Active Member
Licensed User
Longtime User
Thanks again for the reply Margret. I am not at my machine today, so will not be able to do anything until tomorrow, UK Time ! I'll post my result when done.
 

dealsmonkey

Active Member
Licensed User
Longtime User

When I try this I get the following error when compiling

B4X:
B4A line: 1073
testftp.SendCommand(\
javac 1.6.0_21
src\com\nejo\c2dm\frajobentry.java:3281: cannot find symbol
symbol  : method SendCommand(anywheresoftware.b4a.BA,java.lang.String,java.lang.String)
location: class anywheresoftware.b4a.net.FTPWrapper
mostCurrent._testftp.SendCommand(processBA,"MKD","testfolder");
 

dealsmonkey

Active Member
Licensed User
Longtime User
Hi Margret,

Sorry for the delay in getting back on my issue. It was all MY fault !!

I had copied the new net 1.35 library to my "Add Lib" folder instead of my "Lib" folder, so was still accessing the old net.jar !!

Better get my noob hat out of the cupboard !!
 

Planet

Member
Licensed User
Longtime User
hello margret
thanks for the library, you think to add SendCommand in a future release?
 

dealsmonkey

Active Member
Licensed User
Longtime User
Hi Margret, is it possible to increase the size of the upload progress box ? On my Nexus 7, the button is cut off half way down. I can upload a screen grab if needed.

Ps. Great lib by the way, works like a charm
 

margret

Well-Known Member
Licensed User
Longtime User
Hi Margret, is it possible to increase the size of the upload progress box ? On my Nexus 7, the button is cut off half way down. I can upload a screen grab if needed.

Ps. Great lib by the way, works like a charm


Yes, if you would, please post a screen grab so I can better understand what it's doing.
 

dealsmonkey

Active Member
Licensed User
Longtime User
Yes, if you would, please post a screen grab so I can better understand what it's doing.

Sorry for the delay in doing this ! Attached is a screen shot. As you can see the progress box is relatively small and the button is cut off..
 

Attachments

  • device-2013-08-23-165142.png
    311.6 KB · Views: 236
Cookies are required to use this site. You must accept them to continue using the site. Learn more…