Transfer files through FTP with .net control as activex in IE
-
: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
-
: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
-
.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.
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
-
: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
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[^]
-
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
-
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[^]
Thanks minhpc_bk, I'll look form information on these links, The answer will surely be there. :)
-
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.
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
-
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
-
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.
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