So i was working on some project but there is only one problem: after the server receive the file i can't do anything to it... So here is how it is: The user chooses a file... The file changes to some special format i made... then sent to my server... My server keeps waiting for files... then the file comes to me BUT ANYTHING after the code that receives the file doesn't excute i don't know why...
What do i want exactly: i want the code to run(In english I want my files to be converted to normal files)... I tried putting "ConvertFile()" in every place possible
var listener = new TcpListener(IPAddress.Parse("---.---.-.---"), ----);
listener.Start();
while (true)
{
using (var client = listener.AcceptTcpClient())
using (var stream = client.GetStream())
using (FileStream output = new FileStream("result.dat", FileMode.Create))
{
var buffer = new byte[1024];
int bytesRead;
while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0)
{
output.Write(buffer, 0, bytesRead);
}
ConvertFile("result.dat");
}
}