FTP connection on mobile device works over wifi but fails over 3G

Hi all,
Hoping someone can help, or has come across this issue.
I am developing a mobile app using flash builder 4.6 with the flex 4.6 sdk. My app needs to transfer files via ftp.
The issue I am experiencing is that the ftp connection establishes and files transfer without a problem when connected via wifi, on both android and ios platforms.
However, when only connecting via a 3G connection on a device, a problem occurs. While I can establish a connection, when I send the USER command, I never receive a response.
A simple view with code to reproduce this issue is listed below. Has anyone come across this problem? I have been searching far and wide but cannot find anything related.
Could this be an issue with Adobe Air or the socket class? I have written equivalent code using the android sdk in eclipse, and a connection to the same server and user details works on both wifi and 3g connections.
Any help would be appreciated.
Thanks.
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
          <fx:Script>
                    <![CDATA[
                              private var commands:Array;
                              private var s:Socket;
                              private var data_channel:Socket;
                              private function connectToFtp():void
                                        var ftp_response:String;
                                        var data_response:String;
                                        var data_channel_ip:String;
                                        var data_channel_port:int;
                                        s = new Socket();
                                        s.addEventListener(Event.CLOSE, closeConnection);
                                        s.addEventListener(Event.CONNECT, connectionMade);
                                        s.addEventListener(IOErrorEvent.IO_ERROR, showError);
                                        s.addEventListener(SecurityErrorEvent.SECURITY_ERROR, showSecError);
                                        s.addEventListener(ProgressEvent.SOCKET_DATA, receiveReply);
                                        s.connect("mydomain.com", 21);
                                        function receiveReply(e:ProgressEvent):void{
                                                  ftp_response = s.readUTFBytes(s.bytesAvailable);
                                                  trace(ftp_response);
                                                  var code:String = ftp_response.substr(0, 3);
                                                  if (code == "220")
                                                            // connected.
                                                            // send user command
                                                             s.writeUTFBytes("USER myUserName\n");
                                                            s.flush();
                                                  else if (code == "331")
                                                            // user command sent. password required
                                                            // send password
                                                            s.writeUTFBytes("PASS myPassword\n");
                                                            s.flush();
                                                  else if (code == "230")
                                                            // login successful
                                                            // change directory
                                                            s.writeUTFBytes("CWD /fibreSyncFtp/\n");
                                                            s.flush();
                                                  else if (code == "250")
                                                            // change directory successful
                                                            // send passive command
                                                            s.writeUTFBytes("PASV\n");
                                                            s.flush();
                                                  else if(code == "227")
                                                            //get the ip from the string response
                                                            var temp:String = ftp_response.substring(ftp_response.indexOf("(") + 1, ftp_response.indexOf(")"));
                                                            var data_channel_temp:Array = temp.split(",");
                                                            data_channel_ip = data_channel_temp.slice(0,4).join(".");
                                                            //calculate the port number from the last two digits - if this makes no sense, google
                                                            // FTP PROTOCOL - there are loads of guides that explain the server responses.
                                                            data_channel_port = parseInt(data_channel_temp[4]) * 256 + int(data_channel_temp[5]);
                                                            data_channel = new Socket(data_channel_ip, data_channel_port);
                                                            data_channel.addEventListener(ProgressEvent.SOCKET_DATA, receiveData);
                                                            s.writeUTFBytes("LIST\n");
                                                            s.flush();
                                                  else if (code == "125")
                                                            //use the new IP to open a second socket - this will transmit the data.
                                                            // Your first socket will transmit any commands you issue and this new socket will transmit the data
                                                  else if (code == "226")
                                                            // transfer complete
                                                            // close the connection
                                                            //s.close();
                                                  else if (code == "425")
                                                            // can't open connection
                                        function connectionMade(e:Event):void
                                                  trace("Connection Made");
                                        function receiveData(e:ProgressEvent):void{
                                                  data_response = data_channel.readUTFBytes(data_channel.bytesAvailable);
                                                  trace(data_response);
                                        function showError(e:IOErrorEvent):void{
                                                  trace(e.text);
                                        function showSecError(e:SecurityErrorEvent):void{
                                                  trace(e.text);
                                        function closeConnection(e:Event):void{
                                                  trace(e.type);
                    ]]>
          </fx:Script>
          <fx:Declarations>
                    <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>
          <s:Button top="10" label="FTP" click="connectToFtp()" horizontalCenter="0"/>
</s:View>

Probably you need to write your own AIR native extension, which uses the native Android sockets..I have the same problem and I'm just starting writing the extension...I guess there is no other way..At least you test with native android socket and you confirm is fine, so we know it should work

Similar Messages

  • SSH works internally over wifi, but not over router

    I feel really embarassed I cannot figure this one out, and I have configured ssh years ago.  I am able to ssh via my Android device over wifi.  Details below.  Thank you in Advance!   Connect Bot follows a different "format" for connection obviously, compared to a Linux workstation.
    router information
    Router Name
    DD-WRT_mike
    Router Model
    WZR-600DHP
    Firmware Version
    DD-WRT v24SP2-MULTI (11/04/12) std - build 20180
    sshd config file
    http://pastebin.com/bNnCmjay
    NAT/QOS
    Applicatoin: ssh ArchBoxMTD
    Protocol(s): Both
    Port in: 22
    Port out: 22
    Destination: 192.168.11.30 [my pc]
    Device Information:
    Android 4.2.1
    Client: ConnectBot
    Connection 1:
    Network: Home Wifi
    Connection String: "[email protected]:22"
    Status:  [sucessful]
    Connection 2:
    Network: Verizon 4G
    Connection String: "mikeyd@<router_ip>:22"
    Status:  [failed]
    I know there has to be something on my router, or verizon has an issue with this.  As it was several years ago, I am hoping someone here can help me out.  I searched for "ssh" "ssh verizon" and other things, but couldn't find a concrete answer, so if there is one in another post, I do apologize in advance.
    Mike
    Last edited by degmic71 (2013-08-22 02:39:55)

    rman wrote:
    Right now I'm suspecting the DD-WRT router. Does your deluge port forward work correctly?
    Also, do you have iptables on your Arch box? If so, show us
    iptables -nL
    There you are sir: http://pastebin.com/7AW1gdN0
    On Deluge I go through BTGuard, so naturally I get "no incoming connections"  But my speed is fine 9.6 Mb/s on average.  (I pay for 10/1 service).  I can show you any configs from that if you wish.  Don't mind the ip table entry there, that was from me adding port 6969 originally, after reading the troubleshooting area of the Arch SSH wiki.  I really appreciate the help guys, I really do.

  • TS1567 Suddenly my I phone 4 will not connect message mobile device service could not be started (nothing has changed on my PC). I have tried following the troubleshooting and have restarted the mobile device) but it still won't connect. Also all my disap

    Suddenly my I phone 4 will not connect message mobile device service could not be started (nothing has changed on my PC). I have tried following the troubleshooting and have restarted the mobile device) but it still won't connect. Also all bookmarks have disappeared!

    Okay ... it's a better bet with a 1067 error message when trying to start the Apple Mobile Device Service, but we'd better check for a LSP issue, as per the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store

  • Facetime, imessage and find my ipad doesn`t work over wifi but they work over 4g

    Facetime, imessage and find my ipad doesn`t work over wifi but they work over 4g, please help me

    Are you sure?
    According to Apple Facetime will only work over WiFi. IOS 6 will bring feature that you can make Facetime call over 3g-4g

  • I was trying to send a video via iMessage over wifi, but was only allowed to send a fraction due to the size limit. Does anyone know what exactly the limit is? Thanks!!

    I was trying to send a video via iMessage over wifi, but was only allowed to send a fraction of the video due to the size limit. Does anyone know what exactly the limit is? Thanks!!

    You said:  "I've never tried the restore function in disk utility. Would that be the same as cloning the drive?
    YES!  See the my old instructions below.  What you might try after step 5 is to restart you MBP holding down the Option key.  Select the new HDD icon and see if it boots.  This way you will know that the new HDD is operable.
    Ciao.
    INSTALLING A NEW HDD IN A MB
    1. Make certain that you have backed up all of your important data.
    2. You will need a HDD enclosure.  One with a USB connection will do.  A 9 pin Firewire is better.
    3. Install your new drive in the enclosure and connect it to your MBP.
    4. Open DISK UTILITY>ERASE.  From the left hand column drag the new drive into the 'Name' field.  Make sure that the format is 'Mac OS Extended (Journaled)'.  Click on the 'Erase' button.
    5. Click on the 'Restore' button (on top).  Drag the old drive into the 'Source' field and the new drive into the 'Destination'  field.  Click on the 'Restore' button on the bottom right hand corner.
      Depending upon the amount of data you are transferring, this may take a couple hours or more.  A Firewire will speed up the transfer.  This will result in both drives having identical information on them.
    6. After the data transfer has completed, you may swap the drives.  Start the MBP and you have finished the installation.  The initial boot may take a bit longer than you are accustomed to, but that is normal.
    7. When you are satisfied that the new hard drive if functioning properly, you can erase the old drive and use it for any needs that you may have.

  • I am planning a long vacation and taking my laptop but it is my home computer that my new ipad and ipod touch are synced too. I know i can backup to the cloud over wifi but how can i do things like delete photo albums

    I am planning a long vacation and taking my laptop but it is my home computer that my new ipad and ipod touch are synced too. I know i can backup to the cloud over wifi but how can i do things like delete photo albums instead of having to manually delete pictures one by one on the Ipad. Is there any way also to add my pictures to the ipad other than through email. i am assuming that i can't just install itunes on the laptop and sync to that. I have been told that i always have to sync to my original synced home computer for that.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • ITunes finds my iPad over wifi but after a few seconds it disappears. What should I do?

    iTunes finds my iPad over wifi but after a few seconds it disappears. What should I do?

    Hi there,
    You may find the troubleshooting steps in the article below helpful.
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi Syncing
    http://support.apple.com/kb/TS4062
    -Griff W.

  • Facetime on MacBook doesn't work on wifi but works fine on Ethernet

    Title describes it accurately. Yes I have updated Facetime and OS X after the April 16th problem and yes the other person is updated. I don't believe it's a wifi hardware problem, considering I am able to connect to websites and IRC using wifi, but Facetime always fails on wifi. I can't find anything about it anywhere.

    Hey Electechnotica,
    Thanks for using Apple Support Communities.
    FaceTime for Mac: Troubleshooting FaceTime
    http://support.apple.com/kb/ts4185
    If you encounter issues using a Wi-Fi network, use standard Wi-Fi network troubleshooting to resolve interference and other issues.
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398
    Have a nice day,
    Mario

  • Why can't i access a site over wifi but can access the site using 3G on iPhone?

    My children can access their school's intranet over wifi, but cannot access their school email accounts on the intranet, or any documents attached to the site (i.e. homework documents).  They can access all of the above via their iPhones using 3G. 

    Try:
    Clear the cookies ('problematic' site(s) only): Tools > Options > Privacy > Cookies: "Show Cookies"
    Clear the cache: Tools > Options > Advanced > Network > Cache: "Clear Cache Now"

  • Tried to use iphone connecting to wifi but failed dispite password correct, cable connection ok, and even reset network setting in iphone. Anyone can help? KC

    Tried to use iphone connecting to wifi but failed dispite password correct, cable connection ok, and even reset network setting in iphone. Anyone can help?
    Kin Chi

    I get in now with the following procedures taken:
    1. Reset network as suggested in Apple app.
    2. In the wifi connection, instead click in the user name as shown in the screen, I click Others and re-type the user name as appeared before. In the security, instead of none, I click WEP. It will then prompt you to put in password. I then put in password as I know for that user name again.
    Then, it joined the wifi..
    Hope this can help someone who get this problem.
    Kin Chi

  • Hi, does anyone know why I cant send email over 3g but can over wi-fi.  My provider is ntlworld

    Hi, does anyone know why I cant send email over 3g but can over wi-fi.  My provider is ntlworld.  As soon as I get home and connect to wi-fi the mail sends no problem

    We use ntlworld as our home broadband provider and main email address.  In my experience ntl doesn't usually allow sending of email except on its own network which is why yours works at home.  My iPhone is set up to send my ntl email using my second email account's smtp setting (in my case is is a mac.com account and I haven't found any network this doesn't work on  to send email). 
    So my advice is to get yourself another email account with a different provider like yahoo or google, then use the new provider smtp address to send your ntl email on your iPhone.

  • Odd high data consumptio​n on 10.3.1 (and 10.2.1) - on wifi, but routing over mobile network?

    Couldn't find a similar recent thread. Just an inconclusive one from 2013 that looked more about the difference between BBOS 7 & BB10.
    tl;dr: It looks like my Z10 is routing some traffic to the mobile network when to applications it looks like the wifi connection is active.
    I have not previously had high data-use issues with my Z10. On Friday February 20th, I updated to 10.3.1.1581. On Friday March 6th, I got a notice saying I'd used 75% of my data (billing cycle is on the 18th, 800MB limit). At that point, the device monitor said I'd used ~300MB*.
    Woke up the next morning and say an alert that came in overnight saying I'd gone past my limit, and the device monitor said I'd used ~540MB.
    240MB of mobile network data use while I was at home, connected to wifi, and asleep. The device monitor attributed it to "System". Normally, my mobile data use is mostly PIM and Browser.
    I looked back in the data usage report from Koodo and saw that there was a previous, similar spike on Feb 20, earlier in the day before the 10.3.1 upgrade. Right around the time I turned on wifi at work and put the phone on its dock, hoping to start the upgrade. That failed due to AP issues.
    I use "Pocket Casts" (Android podcast app). It's set to download only when on wifi and connected to power.
    Could it be that it thought I was connected to wifi, but due to weak signal strength, the OS actually routed the connection over the mobile network? I sometimes only have one bar of signal strength in my bedroom.
    If that's the case, why is an Android app's data use recorded as "System" and not at least "Android Player"? It looks like it must be lumped in under "System", though, as the wifi usage numbers don't show anything else with enough bandwidth consumption to account for podcast downloads.

    hi,
    what is Koodo and what do "AP issues" mean?
    besides, on Friday 20th, which OS version did you update from?
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • ITunes/Apple Mobile Device works fine w/iPod but not iPad

    Hi. I'm getting stuck on this and would like some help to solving this problem. Basically I'm trying to sync my iPad; however, whenever I connect it, this meesage pops up: "this iPad cannot be used because the Apple Mobile Device is not started." The problem is that when I try to plug in an iPod using the same wire, it works fine, no problem, but the iPad just won't connect. I have since uninstall and reinstall all Apple components (iTunes, AMD, QuickTime, etc) and it's still the same thing...iTunes connects fine w/ the iPod, but not the iPad. What to do? Thnx in advance.
    EDIT:
    Btw, I've tried to connect the iPad while the iPod is connected, and the "Apple Mobile Device is not started" error message pops up too, which is weird, because the iPod is connected and syncing at that time...which means the Apple Mobile Device thing IS started. >.>

    The iOS devices use Apple Mobile Device Service, while older iPods use the iPod Service.
    Checkout this Apple document -> How to restart the Apple Mobile Device Service (AMDS) on Windows
    Are you able to restart the service after following the steps in that article?

  • Why does Time Machine not work over wifi but only via ethernet cable ?

    Hi everyone,
    It's been some time I have this problem now.
    The first time I backed up my mac within Time Capsule with time machine, I chose to use the ethernet cable because the gigabit connection is much faster than the wifi for the first back up, but now, any time I want to update this back up, I need to connect the cable, cause "Time Machine can not connect to the Drive I picked" over wifi.
    This is so annoying. Does anyone have a similar issue ?
    Any solution ?
    When I got this "error" I can use Utility Airport and get full access to the drive, even in finder. The only thing that doesn't work is TimeMachine connecting to the drive, even if it is detected by TimeMachine itself.
    Thanks.
    Riccardo

    Typical Yosemite.
    I suggest a full reconfigure of the TC.
    Follow this list..
    No files are deleted on the TC doing this although you might have to repoint your laptop to the backup.
    Note.. even if TM does connect it will say it is going to do a new backup.. it is only when it starts that it discovers the backup exists and increments it.
    Start from a factory reset. No files are lost on the hard disk doing this.
    Factory reset universal
    Power off the TC.. ie pull the power cord or power off at the wall.. wait 10sec.. hold in the reset button.. be gentle.. power on again still holding in reset.. and keep holding it in for another 10sec. You may need some help as it is hard to both hold in reset and apply power. It will show success by rapidly blinking the front led. Release the reset.. and wait a couple of min for the TC to reset and come back with factory settings. If the front LED doesn’t blink rapidly you missed it and simply try again. The reset is fairly fragile in these.. press it so you feel it just click and no more.. I have seen people bend the lever or even break it. I use a toothpick as tool.
    N.B. None of your files on the hard disk of the TC are deleted.. this simply clears out the router settings of the TC.
    Setup the TC again.
    Then redo the setup from the computer with Yosemite.
    1. Use very short names.. NOT APPLE RECOMMENDED names. No spaces and pure alphanumerics.
    eg TCgen5 for basestation and and TCwifi wireless name.
    If the issue is wireless use TC24ghz and TC5ghz with fixed channels as this also seems to help stop the nonsense. But this can be tried in the second round. ie plan on a first and second round of changes to fix this.. hopefully.. I will point out other steps that can be round2.
    2. Use all passwords that also comply with 1. but can be a bit longer. ie 8-20 characters mixed case and numbers.. no non-alphanumerics.
    3. If the TC is main router you can skip this point. This is only an issue when the TC is bridged.
    Ensure the TC always takes the same IP address.. you will need to do this on the main router using dhcp reservation.. or a bit more complex setup using static IP in the TC. But this is important.. having IP drift all over the place when Yosemite cannot remember its own name for 5 min after a reboot makes for poor networking.
    4. Check your share name on the computer is not changing.. make sure it also complies with the above.. short no spaces and pure alphanumeric.. but this change will mess up your TM backup.. so be prepared to do a new full backup. Sorry.. keep this one for second round if you want to avoid a new backup.
    5. Mount the TC disk in the computer manually.
    In Finder, Go, Connect to server from the top menu,
    Type in SMB://192.168.0.254 (or whatever the TC ip is which you have now made static. As a router by default it is 10.0.1.1 and I encourage people to stick with that unless you know what you are doing).
    You can use name.. SMB://TCgen5.local where you replace TCgen5 with your TC name.. local is the default domain of the TC and doesn't change.
    However names are not so easy as IP address.. nor as reliable. At least not in Yosemite they aren't. The domain can also be an issue if you are not plugged or wireless directly to the TC.
    6. Make sure IPv6 is set to link-local only in the computer. For example wireless open the network preferences, wireless and advanced / TCP/IP.. and fix the IPv6. to link-local only. Do the same for ethernet if you use it.
    There is a lot more jiggery pokery you can try but the above is a good start.. if you find it still unreliable.. don't be surprised.
    You might need to do some more work on the computer itself. eg Reset the PRAM.. has helped some people. Clean install of the OS is also helpful if you upgrade installed.
    Tell us how you go.
    Someone posted a solution.. See this thread.
    Macbook can't find Time Capsule anymore
    Start from the bottom and work up.. I have a list of good network practice changes but I have avoided Yosemites bug heaven.
    Yosemite has serious DNS bug in the networking application.. here is the lets say more arcane method of fixing it by doing a network transplant from mavericks.
    http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-is-broken-and-what-yo u-can-do-to-fix-it/

  • IPhone 4 connected to work's wifi, but won't connect to Internet

    Hi there
    We have multiple iPhones and an iPad at work, and I'm having a **** of a problem betting them to use the work's wifi connection. We have a Netgear DG834G Wireless Router, which is a 108g spec wireless. The wired network uses static IP addresses (for all the macs and PCs we have here), but the wireless appears to use DHPC (as the devices are allotted an IP address beginning with 169) and WPK-PSK security. The settings on the server suggest that the DHCP addresses are supplied by the ISP. The MAC addresses of the iPhones and iPad have been added to the router's 'allowed' list. The iPhones and iPad work fine on other wireless networks, suggesting an issue with either static IP systems, or WPK-PSK security.
    All the devices 'see' the wireless network, and appear to connect to it fine, but when I look at the displayed network icon, it is still using GPRS and not Wifi (we work out in the back of beyond, so no 3G).
    Any ideas?

    Hi Laurence
    Thanks for your help. The info that the IP address starting 169 were self assigned led me to re-look at the setting on the router. The DCHP wasn't set up properly, an now everything works as it should. Thanks!

Maybe you are looking for

  • How do I make Mail stop showing notes in my inbox?

    The obvious answer is to turn off the "show notes in Inbox" option in the Mailbox Behaviours tab of Account Info, but that option is not sticking. Mail in Lion keeps re-enabling the "show notes in Inbox" option across Mail restarts. The checkbox is n

  • Return sales excise posting

    Dear Excperts, For return sales we are posting the excise JV through J1IH  in additional excise tab with reference to excise invoice.but  when we are seeing the same in J2I9 abstract view the values showing under crdit utilized during the month .but

  • Need help on setting up my alarm

    How can I extend the duration the alarm plays on a blackberry curve?  I have a 25 minute song I want played every morning and have it come on as my alarm.  How do I change the duration of the alarm in order to hear the whole song?  As default setting

  • Jdeveloper 11g deployed jar not running - Windows 7

    After I deployed a simple form to a jar, the following message comes up when trying to run with command: java -jar  sw.jar Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jbo/uicli/controls/JUNavigationBar Caused by: java.lang.Class

  • Select tool does not work

    Select tool has quit working.  Click on it and the snap shot tool appears.  All other tools work fine.  Uninstalled and reinstalled reader but problem remains.