Download google drive here : https://drive.google.com/file/d/1EVX1...
My fiverr link: https://www.fiverr.com/hamzakhalid178
My Upwork Profile: https://www.upwork.com/freelancers/~0...
Whatsapp Number: +923338672398
add namespace:
using System.IO;
using System.Net;
code of FTPHelper
public FTPHelper(string address,string login,string password)
{
Address = address;
Login = login;
Password = password;
}
public string Upload(MemoryStream stream,string fileName)
{
try
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(Address + @"/" + fileName);
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(Login,Password);
request.UseBinary = true;
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
stream.Close();
Stream requestStream = request.GetRequestStream();
requestStream.Write(buffer, 0, buffer.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
response.Close();
return "successful";
}
catch(Exception ex)
{
return ex.InnerException.ToString();
}
}
public string Address { get; set; }
public string Login { get; set; }
public string Password { get; set; }
code of button:
byte[] data;
using(Image image=Image.FromFile(@"C:/Users/923400221916/Desktop/uploadpicture.jpg"))
{
using(MemoryStream m=new MemoryStream())
{
image.Save(m, image.RawFormat);
data = m.ToArray();
}
}
FTPHelper fTPHelper = new FTPHelper("ftp://ipaddress:portnumber/images/", "username", "password");
string result = fTPHelper.Upload(new MemoryStream(data), "Uploadedpicturename.jpeg");
MessageBox.Show(result);
please contact us for custom softwares:
comment on the video if any question.
Watch video Upload Image on ftp server using winform C# online without registration, duration hours minute second in high quality. This video was added by user IT Core Soft 20 December 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,562 once and liked it 21 people.