Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/01/2012, 06:54
Pimager
 
Fecha de Ingreso: julio-2010
Mensajes: 298
Antigüedad: 13 años, 10 meses
Puntos: 8
Respuesta: Problema al guardar imagen

Hola a todos, he conseguido resolverlo. Dejo el código a continuacón por si a alguien le puede servir.
Código:
Stream rs = (Stream)context.Request.InputStream;
                               
FileStream fs = new FileStream("c:/docs/uploadFiles/image.jpg", FileMode.Create);
byte[] byWork = new byte[2047];
int iWork;

do
{
     iWork = rs.Read(byWork, 0, byWork.Length);
     fs.Write(byWork, 0, iWork);
} while (iWork != 0);

fs.Flush();
fs.Close();
rs.Close();
Un saludo