"I/O ERROR OCCURED while download/ upload a file from FTP using Wininet.dll

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Manikgisl
    New Member
    • Oct 2008
    • 37

    #1

    "I/O ERROR OCCURED while download/ upload a file from FTP using Wininet.dll

    hi,

    we have developed one application.Tha t will download a zip file from ftp to enduser machine,,,

    For download a file from ftp ..we are using "Wininet API" to download

    But its not working

    1.Ftp is connecting

    2.its Locating the target folder tooo

    but its not downloading the file to localmachine...

    The error " I/O error Occured"

    we have 25 users on it....it working them

    but we installed for one user it not working

    1, we have given permissions to local machine...
    2. the enduser netspeed is fine...
    3.we can copy the file from ftp to localmachine... but its working fine...


    Can anybody give me solution for this??

    Thanks in advance

    Regards,
    Mani
  • maxamis4
    Recognized Expert Contributor
    • Jan 2007
    • 295

    #2
    What are the differences from this users machine in comparison to the other users using it?

    More details please

    Browser types

    Hoxfixes deployed

    software installed

    this items make a difference.

    Comment

    • Manikgisl
      New Member
      • Oct 2008
      • 37

      #3
      hi,

      That user has Laptop...
      1.Operating System is WinXp
      2.Browser : IE 6.0 , Opera (at first user had,But we asked to uninstall that.)
      3.Antivirus : EScan
      4.Internet Connection : BSNL Broadband 750 UL Plan


      One information.... ..usally if the user has Mozilla firefox as Web browser.it will not work.. we always to uninstall the mozilla firefox.

      We had asked the user the reinstall the OS...
      And then we tested our software the file movement is not worked.

      At first she had the Vista as OS and we have some other issues in her system... so we had ask her to change OS to WinXp

      She has installed the WinXp OS as pirated version...

      With Regards,

      Mani

      Comment

      • maxamis4
        Recognized Expert Contributor
        • Jan 2007
        • 295

        #4
        What type of code is the app written in? More curísoity than añy thing else. Alos i want to confirm the other usérs are working right? What is there configuratíon.

        Comment

        • Manikgisl
          New Member
          • Oct 2008
          • 37

          #5
          hi,

          this is code we are using to download a file from ftp


          public bool fnWinInetDownlo ad(string strFTPAddress, string strFTPUserName, string strFTPPassword, string strFTPDirectory , string strFTPDownloadF ileName, string strLocalFileNam ePath)
          {
          IntPtr inetHandle = IntPtr.Zero;
          IntPtr ftpconnectHandl e = IntPtr.Zero;
          try
          {
          //check for inet connection
          if (__InternetAtte mptConnect(0) != ERROR_SUCCESS)
          {
          fnMessageHeader ("No connection to Internet available! Please Check!!", 1);
          return false;
          }
          //connect to inet
          inetHandle = __InternetOpen(
          "billyboy FTP", INTERNET_OPEN_T YPE_DIRECT, null, null, 0);
          if (inetHandle == IntPtr.Zero)
          {
          fnMessageHeader ("Couldn't establish a connection to the Internet! Please Check!!", 1);
          return false;
          }
          //connect to ftp
          ftpconnectHandl e = __InternetConne ct(inetHandle, strFTPAddress, 21, strFTPUserName, strFTPPassword,
          INTERNET_SERVIC E_FTP, 0, 0);
          if (ftpconnectHand le == IntPtr.Zero)
          {
          fnMessageHeader ("Couldn't connect to FTP! Please Check Internet Connection!!", 1);
          return false;
          }
          //set to desired directory on FTP server
          if (! __FtpSetCurrent Directory(ftpco nnectHandle, strFTPDirectory ))
          {
          fnMessageHeader ("Couldn't set to desired Directory! Please Check FTP Directory Exists!!", 1);
          return false;
          }
          //download file from server
          if (! __FtpGetFile(ft pconnectHandle, strFTPDownloadF ileName, strLocalFileNam ePath, false, 0, 0, 0))
          return false;
          else
          return true;
          }
          catch(Exception ex)
          {
          throw ex;
          }
          finally
          {
          //close connection to ftp
          if (ftpconnectHand le != IntPtr.Zero)
          __InternetClose Handle(ftpconne ctHandle);
          ftpconnectHandl e = IntPtr.Zero;
          //close connection to inet
          if (inetHandle != IntPtr.Zero)
          __InternetClose Handle(inetHand le);
          inetHandle = IntPtr.Zero;
          }
          }

          Regards,

          Mani

          Comment

          Working...