FTP server, HTTP server, B4AServer, which is more appropriate?

Mahares

Expert
Licensed User
Longtime User
1 I would like to create text files (10 to 100 KB) on my device on a daily or weekly basis and upload the files remotely to my PC (not a web site). I also would like to download text files from my PC (not a web site) to my device.
2. The files must be uploaded and downloaded to the same PC and device folders each time. I do not want to email the files to myself.

I have read many threads in the forum related to FTP server, HTTP server, B4A server. I am totally clueless. What are the benefits of one over the other and how to proceed to get started with one of the three that would be simple, reliable and consistent, but not necessarily the fastest as these files are small. The more I read, the more intense my confusion gets. Any plain easy to follow instructions or approach would be greatly appreciated.
Thank you
 

r2d4

Member
Licensed User
Longtime User
I think FTP is more suitable, because FTP is made for transfering files.
E.g. with FTP you could normally resume a broken upload.

Plus you have to configure less, than configuring a HTTP server. The only thing you need is a local FTP server which is reachable from the internet. (Keywords: DMZ, port forwarding).
 
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Erel, I am intrigued by B4AServer threads and tutorial, but also intimidated. Do I simply install the server portion of B4AServer on my PC and be ready to go or what else is required and hidden that I need to perform to make it operational, other than coding the device to receive and send files.
Thank you for clear explanation.
 
Upvote 0

r2d4

Member
Licensed User
Longtime User
I do not know the source of b4a-server. But what I know is, often it is better to use a very known and stable product (like Apache for webservices) if it is connected to the internet.

Plus what makes me a little bit headdache is: "Run predefined executables or shell commands and return the result to the device."

If you don't need that function, may be it is better to use a ftp server to provide you only the functionality you need (up + download).
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
To implement B4AServer I did the following, but I am not sure what I accomplished. I could use some clarifications and help:
1. I Downloaded both zip files. B4AServerDevice and B4AServerDesktop and unzipped the files.
2. I Opened the B4A project B4AServerExample and replaced the following: ServerName = "test1" with ServerName = "dell4600" which is my PC name. Do I need the UNC name or what.
3. I opened a file on PC called: config.properties and replaced Test1 with my server name
#This is the unique server name you choose.
#ServerName=test1
ServerName=dell4600 What goes in here?
#Folder for files that can be downloaded to a device
InputFolder=files What goes in here?
#folder for uploaded files
OutputFolder=files What goes in here?
4. I double clicked a file called: run.bat and minimized the DOS window.
5. I deployed the project to my device. When it started, I clicked receive file. After that. I have no idea where it is getting the file from and where it is saving it to on my PC. Nothing happened on the device. On the PC DOS window I get: Trying to connect to 10.162.134.5:7890, then errors.
Do I need to change the folders on the config.properties files to folders on my PC?
Thank you
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I am confused about the server and other folders naming convention you use. See below what I have in the config.properties file: I also attached the error message as an attachment:

#This is the unique server name you choose.
#ServerName=test1
ServerName=dell4600
#Folder for files that can be downloaded to a device
#InputFolder=files
InputFolder=G:\Temp
#folder for uploaded files from device to PC
#OutputFolder=files
OutputFolder=G:\Temp
#number of devices that can connect at the same time
WorkerThreads=5
#link to the board server
BoardUrl=http://b4aserver.basic4ppc.com/b4a_server.php
#Interval measured in seconds. The desktop server polls the board server every x seconds.
CheckInterval=5
#list of shell commands
Shell.Print="c:\\program files\\PrintHTML\\printhtml.exe" printername="novapdf" header="" footer=""
Shell.Dir=cmd.exe /c dir files
 

Attachments

  • ErrorMessage.JPG
    ErrorMessage.JPG
    72.6 KB · Views: 296
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thank you Erel for your efforts. This project of the B4Aserver is taking me too long. It should not be complicated like this. I am confused about what to put in the config file as to the exact syntax for the paths of the download and upload files, the server name syntax and the IP address. If I see a real functioning config file, it would help some. I have no clue how this process works. I will get back to you in a few days.
 
Upvote 0
Top