Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.5k views
in .NET FTP by (300 points)
Hi friends, i have a doubt about this component. I am developing a ASP.Net application and i would like offer to the client the upload option (upload files to server) and i would like to do this via FTP. I dont know if this component can be used to do this or its impossible. I think that if i write this part of code:

Ftp1.Connect();

Ftp1.DownloadFile();

...will be the server which will connect to a FTP server and the server will be which download the file. Are this right?


:cry: :cry: :cry:

If edtftpnet/pro can be used with the asp.net web page, so that client can upload or download multiple files from their client
machine to server via this ftp solution, please let me know and it's very urgent. Thanks in advance.

5 Answers

0 votes
by (51.6k points)
No, the components in the edtFTPnet line of products cannot be run inside the browser (except in a Silverlight application). This is because browsers cannot run .NET CLR code.

You might like to consider Integral FTP, which uses an invisible applet to implement a Javascript FTP component.

- Hans (EnterpriseDT)[/url]
0 votes
by (300 points)
Thanks for your advice. But I don't think that Integral FTP is not a good solution for me.
Because I want to let the user upload bulk amount of files at a time and in my asp.net,
I need to do some coding for database entry according to the files uploaded by the user.

So, can you please let me know whether is it possible to use Integral FTP with my asp.net
application and I am able to code for database entry according to the files uploaded by
the user. at back end of asp.net page.

Or it will be better if you can help me to Implement edtftpnet/pro with a silverlight application.
I will be grateful to you, If you can send me any asp.net silverlight demo project with edtftpnet/pro.

Thanking You
Subimal Nath
0 votes
by (51.6k points)
Hi Subimal

Integral FTP runs exclusively inside the browser and relies only on HTML/Javascript and the Sun Java plug-in. Since it doesn't rely on any server-side code it can be used with ASP.NET, JSP, PHP, Ruby, Python or any other server-side scripting technology. While it does utilize the Java plug-in, it does not require you to develop any Java code.

Integral FTP uses edtFTPj at its core so it is fast and robust (see here). It can be used for uploading a large number of files. Since it can be programmed in Javascript and you get a callback each time a file has finished uploading, you will be able to detect when all files have finished uploading, and take any action you like. For example, on completion of the final upload you can redirect the browser to another page which triggers a query on the server.

I can't send you any sample projects with Silverlight since we don't have any. In fact we've only done some preliminary experiments with Silverlight so I probably shouldn't even have mentioned it.

- Hans (EnterpriseDT)
0 votes
by (240 points)
It can't be run on the browser but you can certainly design a interface with web controls then use the component in the code behind. For example, add a button to a ASP.NET page and do something like this when the button is clicked (in C#):

        protected void btnConnect_Click(object sender, EventArgs e)
        {
            string host, user, password; // supply these yourself

            FTPClient ftp = null;
            try
            {
                // set up client
                ftp = new FTPClient();
                ftp.RemoteHost = host;
                ftp.Connect();
                
                // login
                ftp.Login(user, password);

                // set up passive Binary transfers
                ftp.ConnectMode = FTPConnectMode.PASV;
                ftp.TransferType = FTPTransferType.BINARY;

                // get directories
                string[] files = ftp.Dir(".", true);
                for (int i = 0; i < files.Length; i++)
                    // do something with the files...

                // copy file to server 
                ftp.Put("readme.txt", "readme.txt");
                // and other operations
 
                // Shut down client
                ftp.Quit();
            }
            catch (Exception ex)
            {
                // do something with the exception
            }
        }

0 votes
by (162k points)
The crucial thing to remember about the above code is that it is run *on the server*. It can't transfer files from the browser.

Categories

...