Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Transfer files through FTP with .net control as activex in IE

Transfer files through FTP with .net control as activex in IE

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcomsysadmin
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel Santillanes
    wrote on last edited by
    #1

    :doh: Man this is hard to explain, so I hope someone can help me out here :(. I need to get some files from an FTP server, using a .net control as activex in IE. I got to the point where I can show the interface and execute code from the .net control shown with object tags in the page... The deal is, as a test I use an interface (Control Library project) that connects to an FTP server and retrieves a file from there. No problem, if I test this in a Windows application project the control does get the file. But when I try to download from FTP with this interface from internet explorer, the FTP library says it can't connect to the server, and that's it. Help please!! :P If you have a link to some information, that would be really appreciated, or a solution, that would be even better :cool:. Thanks in advanced. daniero

    I M 2 Replies Last reply
    0
    • D Daniel Santillanes

      :doh: Man this is hard to explain, so I hope someone can help me out here :(. I need to get some files from an FTP server, using a .net control as activex in IE. I got to the point where I can show the interface and execute code from the .net control shown with object tags in the page... The deal is, as a test I use an interface (Control Library project) that connects to an FTP server and retrieves a file from there. No problem, if I test this in a Windows application project the control does get the file. But when I try to download from FTP with this interface from internet explorer, the FTP library says it can't connect to the server, and that's it. Help please!! :P If you have a link to some information, that would be really appreciated, or a solution, that would be even better :cool:. Thanks in advanced. daniero

      I Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      .NET 1.1 doesn't have FTP you would need to PInvoke the wininet.dll ( C++ API ) View that dll. Its easiest to view the .h file with notepad. net 2.0 has it though nick I'm not an expert yet, but I play one at work. Yeah and here too.

      D 1 Reply Last reply
      0
      • I Ista

        .NET 1.1 doesn't have FTP you would need to PInvoke the wininet.dll ( C++ API ) View that dll. Its easiest to view the .h file with notepad. net 2.0 has it though nick I'm not an expert yet, but I play one at work. Yeah and here too.

        D Offline
        D Offline
        Daniel Santillanes
        wrote on last edited by
        #3

        I have no problem about the FTP library, I already have one from one of the articles in CP, my only problem is making it run in IE when the control library is invoked like ActiveX. daniero

        I 1 Reply Last reply
        0
        • D Daniel Santillanes

          :doh: Man this is hard to explain, so I hope someone can help me out here :(. I need to get some files from an FTP server, using a .net control as activex in IE. I got to the point where I can show the interface and execute code from the .net control shown with object tags in the page... The deal is, as a test I use an interface (Control Library project) that connects to an FTP server and retrieves a file from there. No problem, if I test this in a Windows application project the control does get the file. But when I try to download from FTP with this interface from internet explorer, the FTP library says it can't connect to the server, and that's it. Help please!! :P If you have a link to some information, that would be really appreciated, or a solution, that would be even better :cool:. Thanks in advanced. daniero

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          daniero wrote:

          But when I try to download from FTP with this interface from internet explorer, the FTP library says it can't connect to the server, and that's it.

          Hi daniero, The very first thing that you should be aware that the client needs to have the .Net framework installed if you want the .Net control to run at the client machine via the browser. The second thing that you need to take into account is the permission. By default, the .net assembly hosted in the browser has limited permissions when it's running, for example it might not have the Web Access permission and it's not able to access the resource in the outside world. If this is the case, you can use the .NET Framework Configuration tool (Mscorcfg.msc) to grant the permission to the control assembly. The documents below can give you more information: Configuring Security Policy Using the .NET Framework Configuration Tool (Mscorcfg.msc)[^] Host Secure, Lightweight Client-Side Controls in Microsoft Internet Explorer[^]

          D 1 Reply Last reply
          0
          • D Daniel Santillanes

            I have no problem about the FTP library, I already have one from one of the articles in CP, my only problem is making it run in IE when the control library is invoked like ActiveX. daniero

            I Offline
            I Offline
            Ista
            wrote on last edited by
            #5

            have you tried getting the ftp file by typing the address in, inside internet explorer? What error message does it give? I'm not an expert yet, but I play one at work. Yeah and here too.

            D 1 Reply Last reply
            0
            • M minhpc_bk

              daniero wrote:

              But when I try to download from FTP with this interface from internet explorer, the FTP library says it can't connect to the server, and that's it.

              Hi daniero, The very first thing that you should be aware that the client needs to have the .Net framework installed if you want the .Net control to run at the client machine via the browser. The second thing that you need to take into account is the permission. By default, the .net assembly hosted in the browser has limited permissions when it's running, for example it might not have the Web Access permission and it's not able to access the resource in the outside world. If this is the case, you can use the .NET Framework Configuration tool (Mscorcfg.msc) to grant the permission to the control assembly. The documents below can give you more information: Configuring Security Policy Using the .NET Framework Configuration Tool (Mscorcfg.msc)[^] Host Secure, Lightweight Client-Side Controls in Microsoft Internet Explorer[^]

              D Offline
              D Offline
              Daniel Santillanes
              wrote on last edited by
              #6

              Thanks minhpc_bk, I'll look form information on these links, The answer will surely be there. :)

              1 Reply Last reply
              0
              • I Ista

                have you tried getting the ftp file by typing the address in, inside internet explorer? What error message does it give? I'm not an expert yet, but I play one at work. Yeah and here too.

                D Offline
                D Offline
                Daniel Santillanes
                wrote on last edited by
                #7

                The error message is: No answer received from server. Surely this is wrong, since this works in a Windows application. And I'm certain this problem has something to do with permissions in the client side. daniero

                I 1 Reply Last reply
                0
                • D Daniel Santillanes

                  The error message is: No answer received from server. Surely this is wrong, since this works in a Windows application. And I'm certain this problem has something to do with permissions in the client side. daniero

                  I Offline
                  I Offline
                  Ista
                  wrote on last edited by
                  #8

                  did you pass the login and password data. If you cant get in manually, you cant get in my code. Eliminate the guess work first. I use WS_FTP to do my initial testing Nick I'm not an expert yet, but I play one at work. Yeah and here too.

                  D 1 Reply Last reply
                  0
                  • I Ista

                    did you pass the login and password data. If you cant get in manually, you cant get in my code. Eliminate the guess work first. I use WS_FTP to do my initial testing Nick I'm not an expert yet, but I play one at work. Yeah and here too.

                    D Offline
                    D Offline
                    Daniel Santillanes
                    wrote on last edited by
                    #9

                    Yep, I have the server IP, the user and password, all hardcoded for now, just to test everything out. Looks like min's links have some information that will prove useful. I'll keep you guys updated. Thanks :). daniero

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups