所以我有这个代码,即时尝试返回现有的图片。虽然它不会显示。 Chrome说服务器意外地关闭了连接,firefox说immage中有一个错误。标题返回图像
这是代码;
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
byte[] img = enc.GetBytes(response);
Response.AddHeader("Transfer-Encoding", "Chunked");
Response.AddHeader("Connection", "Keep-Alive");
Response.AddHeader("Keep-Alive", "timeout=1, max=64");
Response.BinaryWrite(img);
var content = fileStorage.readFile(src); // this is the file. Which is return in response
//编辑我无法发布图片。
响应对象究竟是什么?我无法在.NET API中找到小写的readFile。有没有另一种方法可以将它转换为字节?我期望'ASCIIEncoding.GetBytes()'是问题所在。 – Rup 2011-12-19 10:51:13