FTP: I Can only download and upload within WiFi Range

Mahares

Expert
Licensed User
Longtime User
I can upload and download files from a PC server (not a web server) running FTP when I am within WiFi range, but nothing happens if I am outside the range or doing the transfer from a remote location. I am using a real device. Is that the way FTP is supposed to work? I am puzzled.
Thank you.
 

NJDude

Expert
Licensed User
Longtime User
If you have setup any kind of server (web server, FTP, etc) on your LOCAL network it will have a local IP, therefore, not accessible from anywhere but your local network, so, if the IP of your PC and FTP server in this case is something like 192.168.xxx.xxx or 10.xxx.xxx.xxx then can be ONLY accessed when in range, if you want to access your server from the internet you will need a PUBLIC IP.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
How do I then get a PUBLIC IP for this server? I have a small web site that is being hosted by a third party. Will I need to transfer the web site to my server to have access to the PUBLIC IP?
Thank you for steering me out of the dark ages.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
You also should not need an IP, you should be able to access your FTP site if the DNS is setup correctly with ftp.yourdomainname.com
Margret: Could you please elaborate a little bit on what I am supposed to do to get the FTP working where I can download and upload the server remotely. I do not mind transfering the web site to my server, as the web host is no longer interested in hosting it. I am not well versed in the ins and outs of web hosting. Therefore, you plain english explanation would be most beneficial to me.
Thanks
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
It is the job of the hosting company to see that your DNS (Domain Name Server) is setup correctly. The DNS takes a name like ftp.yourdomain.com and converts it to an IP number for the route. This requires the proper settings be added to their DNS servers. Some hosting companies have a user control panel and it's your job under some of these companies to setup your own DNS entries. You need to find out if they are to set it up or if you are required to do so. You may find some helpful information if you Google:

Setting up a DNS sever or Add entries to a DNS server.
 
Last edited:
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
I can upload and download files from a PC server (not a web server) running FTP when I am within WiFi range, but nothing happens if I am outside the range or doing the transfer from a remote location. I am using a real device. Is that the way FTP is supposed to work? I am puzzled.
Thank you.

Nothing will happen if you're outside of your wifi range. This would be expected. You need an internet connection that extends beyond your wifi. Normally, this is handled by the cellular connection within our phones which truly makes using FTP seem like magic.

However, it sounds like your device does not have a cellular connection to the internet, is that right?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
rfresh says:
However, it sounds like your device does not have a cellular connection to the internet, is that right?
Mahares responds: I do have internet service via my phone which is the Droid Razr (top of the line). But if you read NJDude's response, he mentions that since I am on a local network, I cannot send or receive from the device unless I am within range of a WiFi. I am trying to decypher what Margret is telling me to do, but I am still confused with the whole process. I thought FTP will allow me to send and receive from my device as long as I have internet access. But, if you can direct me to a way to upload and download without having to have a web site and without relying on WiFI, you will be my hero.
Thanks
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Ok, it seems to be a little bit of confusion here, yes, like I said in my previous post what you need is a PUBLIC IP, if you want to do that you need to forward port 21 on your router, that way, it can accessed from the "cloud", you will have to refer to your router's manual to read how to do that.

One thing, by exposing your FTP server in this case ANYONE who gets your IP will be able to connect, so make sure is secured, and another thing, if several users connect, your bandwidth will suffer, so keep that in mind too.

Having "home servers" is not recommendable, unless is for testing purposes only.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
But, if you can direct me to a way to upload and download without having to have a web site and without relying on WiFI, you will be my hero.
Thanks
There are many ways to skin a cat.

Using your existing setup:
1. Find your public IP at whatismyip.com ...remember this is the IP address assigned by your ISP and can change at any time unless you have signed up for a static IP.
2. Set up port forwarding on your router. Find the Port your FTP server is serving on, and log in to your router (if you have one) and set up port forwarding.
3. Use your public IP, and the port you specified in your router settings, to access your server from your device.

If you do not understand any of these steps, I suggest you google it, because there may be a lot of information available.

You can use a server if you know how to, as Margaret suggests.

You can use an alternative intermediate, like Dropbox to transfer stuff, and download it back again.
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
I guess I'm confused too about your set up.

>I thought FTP will allow me to send and receive from my device as long as I >have internet access.

This is a true statement...but when you're outside of your wifi area, how do you expect to connect to the internet? (I'm just asking here, to understand myself). If you're outside of your wifi, how will you make your internet connection so you can use your FTP capabilities?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I followed thedesolutesoul instructions to the letter and also followed the instructions on the internet in the following web site: Port Forwarding on the D-Link DI-614+ Router
But neither methods worked. The internet instructions ask to enter the server IP address not the one assigned by my ISP. I changed the following line of code in my project:
B4X:
FTP.Initialize("FTP", "xxx.xxx.0.xxx", 21, "myusername", "mypassword")
to accommodate both the server IP and the ISP and tested both with no success. The port I used is:21.
Bless your Soul.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Okay, what are your port forwarding settings?
What is your PublicIP,PrivateIP,PublicPort, PrivatePort?

For privacy, you can mask out the last octet of the PublicIP, but I want to see the top three octets to make sure it is a valid public IP.

Maybe you can test with an FTP Client on the same machine as well.

Also, what error does FTP initialize return with?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
What is your PublicIP,PrivateIP,PublicPort, PrivatePort

Public IP: 76.125.226.xx
Private IP: 192.168.0.xxx
Private/Public port: 21/21 I extracted this from the FTP server settings option when it is running.

No error is returned by the intitialize statement. Nothing happens at the device or the server level. I have a button to activate the UPLOAD and one to activate the DOWNLOAD. For your information, when I activate WiFi on my device and I am within range of the router, both upload and download work well as expected.
Thank you for your concern
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
The last 2 lines of the filtered and also unfiltered log say:
textfilename Success False
java.net.SocketTimeoutException: Connection timed out
I do not have another FTP application to try.
One thing I need to mention is: The FTP server is one of three machines on the local network, if that means anything. Again, I turned WiFi ON on the phone again and was able to upload. That behavior has not changed.
Thanks again for your perseverance.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
So on your router you set port 21 to forward to Private IP (192.168.0.xxx) port 21. AND enabled it?

The in your code used the Public IP
B4X:
FTP.Initialize("FTP", "76.125.226.xx", 21, "myusername", "mypassword")

And it still doesn't work?

Maybe check any firewalls, software and hardware (router) to make sure then don't block incoming ftp requests.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
My Windows firewall is turned off and the antivirus software firewall was set where all network traffic is UNblocked. I also tested again with the way Barx suggested which is 192.168.0.xxx in the router setting (private IP) and the code on the device showing the public IP: 76.125.226.xx. Still no progress. If there are any other tips, I am willing to implement them as long as you are willing to take on the challenge.
Thanks
 
Upvote 0

alf

New Member
Licensed User
Longtime User
I am in the same situation. I tried with another program (AndFTP) and works perfectly with the same parameters when no WiFi, but my program only works when there is in my WIFI. Address that is trying to access an IP address directly.

213.xxx.xxx.xxx

Thanks
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Alf: I am sorry I am not surer I understand what you are trying to say. If you are trying to help me, please explain in detail the steps. Otherwise, if you are hurting like me, perhaps some other knowlegeable forum user call help steer us to the proper solution.
 
Upvote 0
Top