Click here to Skip to main content
13,045,379 members (94,394 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


11 bookmarked
Posted 13 Oct 2011

Easy FTP Upload without files size limit

Rate this:
Please Sign up or sign in to vote.
Easy FTP Upload without files size limit
The typical way and examples for send(Upload) a file to FTP server uses slow requests and the FileStream class that imposes restrictions in the size of files that are uploaded.

I present my short and easy way to upload a file to FTP server without file size limits:

using System.Net;
            // Get the object used to communicate with the server.
            FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://
            XXXXXXXXXXXXXXXXXXXXX/" + "C:/");
            request.Method = WebRequestMethods.Ftp.UploadFile;
            request.Credentials = new NetworkCredential("User", "PassWord");
            // Copy the contents of the file to the request stream.
            Stream ftpStream = request.GetRequestStream();
            FileStream file = File.OpenRead("C:/");
            int length = 1024;
            byte[] buffer = new byte[length];
            int bytesread = 0;
            bytesread = file.Read(buffer,0,length);
            while(bytesread != 0);
            MessageBox.Show("Uploaded Successfully");

I hope that helps you...:)

Sergio Andrés Gutiérrez Rojas


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sergio Andrés Gutiérrez Rojas
Systems Engineer Motion-Soft CO
Colombia Colombia
Systems engineer
Software developer
Networks technologist
Artificial vision, AI and robotic lover
Technology enthusiast

Motion Soft Co-funder

MIA PC Friend Developer:

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 18 Oct 2011
Article Copyright 2011 by Sergio Andrés Gutiérrez Rojas
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid