Click here to Skip to main content
15,896,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
FtpWebRequest displayRequest = (FtpWebRequest)WebRequest.Create(new Uri(FileSaveUri + scorefilename));
displayRequest.Method = WebRequestMethods.Ftp.DownloadFile;
displayRequest.Credentials = new NetworkCredential(ftpUser, ftpPassWord);


try
{

FtpWebResponse response = (FtpWebResponse)displayRequest.GetResponse();
Stream Stream = response.GetResponseStream();
byte[] bytes = new byte[10240];
int i = 0;
MemoryStream mStream = new MemoryStream();

do

{
i = Stream.Read(bytes, 0, bytes.Length);
mStream.Write(bytes, 0, i);

}

while (i != 0);
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.BinaryWrite(mStream.GetBuffer()); <--- i think this one i needed get convert to binary reader, but i no idea to get it.
mind think already blur, pls help .....
Posted

1 solution

You can use MemoryStream method ToArray() to get array of bytes and then you can insert that array to database.

memory stream to DB[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900