I'm working with ASP.NET(C#) and using CKEditor. When the site is published on the production server, i've noticed the following problem:
- When i try to upload some images (But not every one of them) with the extesion ".jpg" the CKEditor crashes and shows the followiong message: "The server closed the connection without sending any data."
Below fallows the sample of the code that i'm using:
private ArquivoDTO GetDadosArquivoPostado()
{
ArquivoDTO arquivoPostado = null;
HttpPostedFile arquivoUpload = null;
// Valida a upload do arquivo
if ((Request.Files["upload"] == null) || !(Request.Files["upload"] is HttpPostedFile))
{
LogElmah.saveLog("Retorno do Upload está vazio (null).", GSUser.Id, null, null);
return null;
}
// Recupera os dados do arquivo de upload
arquivoUpload = (HttpPostedFile)Request.Files["upload"];
// Valida dados do arquivo
if ((string.IsNullOrEmpty(arquivoUpload.FileName)) && (arquivoUpload.InputStream == null))
{
LogElmah.saveLog("Dados do arquivo de upload inválidos!", GSUser.Id, null, null);
return null;
}
// Gera os dados do arquivo postado
arquivoPostado = new ArquivoDTO()
{
Nome = string.Format("{0}-{1}", DateTime.Now.ToString("yyyyMMddHHmmss"), Guid.NewGuid().ToString()),
Extensao = new FileInfo(arquivoUpload.FileName).Extension.Replace(".", ""),
Caminho = ConfigurationManager.AppSettings["CKEditorCaminhoImagem"],
FileStream = arquivoUpload.InputStream,
};
return arquivoPostado;
}
Anyone else had this problem before?
Some points that i verified:
- Web.config" upload configurations.
- Export the same image again using Photoshop with the option "Save for the Web". When i do this the upload works, but not every one that uses the site has the Photoshop.
Obs: When i try to upload the same image on the local server it works fine, the problem just happens when the site is published and in a production server. Dou you guys have any guess on what could be the problem?
Thanks! Ricardo