try { log.Info("Begin"); requestData.FileName = ""; requestData.ATTACHDOC_RUNNING_ID = ATTACHDOC_RUNNING_ID.Value; //requestData. = "codebase.zip"; log.Info("Begin DownloadFile"); fileInfo = clientDownload.DownloadFile(requestData); log.Info("End DownloadFile"); Response.BufferOutput = false; // to prevent buffering byte[] buffer = new byte[6500]; int bytesRead = 0; System.Web.HttpContext.Current.Response.Clear(); System.Web.HttpContext.Current.Response.ClearContent(); System.Web.HttpContext.Current.Response.ClearHeaders(); System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileInfo.FileName); System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Unicode; System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream"; System.Web.HttpContext.Current.Response.BinaryWrite(System.Text.Encoding.Unicode.GetPreamble()); bytesRead = fileInfo.FileByteStream.Read(buffer, 0, buffer.Length); while (bytesRead > 0) { // Verify that the client is connected. if (Response.IsClientConnected) { Response.OutputStream.Write(buffer, 0, bytesRead); // Flush the data to the HTML output. Response.Flush(); buffer = new byte[6500]; bytesRead = fileInfo.FileByteStream.Read(buffer, 0, buffer.Length); } else { bytesRead = -1; } } log.Info("End"); } catch (Exception ex) { // Trap the error, if any. System.Web.HttpContext.Current.Response.Write("Error : " + ex.Message); } finally { Response.Flush(); Response.Close(); Response.End(); System.Web.HttpContext.Current.Response.Close(); } return Content("");
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง