i wanna read an image (TIF image) from FTP Server and then view it
i used to read from FTP server this code:
//CREATE AN FTP REQUEST WITH THE DOMAIN AND CREDENTIALS
System.Net.FtpWebRequest tmpReq = (System.Net.FtpWebRequest)System.Net.FtpWebRequest.Create(filePath);
tmpReq.Credentials = new System.Net.NetworkCredential(userName, password);
//GET THE FTP RESPONSE
using (System.Net.WebResponse tmpRes = tmpReq.GetResponse())
{
//GET THE STREAM TO READ THE RESPONSE FROM
using (System.IO.Stream tmpStream = tmpRes.GetResponseStream())
{
//CREATE A TXT READER (COULD BE BINARY OR ANY OTHER TYPE YOU NEED)
using (System.IO.TextReader tmpReader = new System.IO.StreamReader(tmpStream))
{
//read and view image
}
}
}
}
i need your help how to convert TIF image to Jepg or other type and also how to read TIF from FTP using my code
thanks
You could use the Image class to perform the conversion. Also make sure you dispose disposable resources such as network streams: