• 主页
  • ASP
  • .NET Framework
  • Web Services
  • VB
  • VC
  • 图表区
  • 分析与设计
  • 组件/控件开发
  • LINQ

关于ASP.NET与IIS返回文件的区别问题

skywatcher 2005-03-17 05:36:07
今天我发现有一个文件(.vga----PowerCreator VGA File)在网页上本来用起来正常,可是我为了权限验证的需要而将这个文件在IIS的配置中设置为由ASP.NET来处理之后,文件照常能够下载,可是失去了在线播放的效果,我认为应该是header的问题,所以我用flashget研究了一下,并更改了一些.NET的输出设置,可是问题还没有解决,现在我将flashget的纪录贴在下面,谁帮我研究一下:

通过IIS返回文件时(运行正常):
Thu Mar 17 17:24:53 2005 正在连接 kunhua:81
Thu Mar 17 17:24:53 2005 正在连接 kunhua [IP=192.168.1.7:81]
Thu Mar 17 17:24:53 2005 已连接.
Thu Mar 17 17:24:53 2005 GET /test/yx/screen.vga HTTP/1.1
Thu Mar 17 17:24:53 2005 Host: kunhua:81
Thu Mar 17 17:24:53 2005 Accept: */*
Thu Mar 17 17:24:53 2005 Referer: http://www.mycodes.net/soft/2753.htm
Thu Mar 17 17:24:53 2005 User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)
Thu Mar 17 17:24:53 2005 Pragma: no-cache
Thu Mar 17 17:24:53 2005 Cache-Control: no-cache
Thu Mar 17 17:24:53 2005 Connection: close
Thu Mar 17 17:24:53 2005 HTTP/1.1 200 OK
//以上相同
Thu Mar 17 17:24:53 2005 Content-Length: 30878343
Thu Mar 17 17:24:53 2005 Content-Type: PowerCreator VGA File
Thu Mar 17 17:24:53 2005 Last-Modified: Thu, 10 Mar 2005 04:56:06 GMT
Thu Mar 17 17:24:53 2005 Accept-Ranges: bytes
Thu Mar 17 17:24:53 2005 ETag: "0f795772d25c51:1582"
Thu Mar 17 17:24:53 2005 Server: Microsoft-IIS/6.0
Thu Mar 17 17:24:53 2005 Date: Thu, 17 Mar 2005 09:24:53 GMT
Thu Mar 17 17:24:53 2005 Connection: close
Thu Mar 17 17:24:53 2005 开始接受数据!
Thu Mar 17 17:24:59 2005 User Cancel at 282362.

通过ASP.NET返回文件时(运行不正常):
Thu Mar 17 17:27:31 2005 正在连接 kunhua:81
Thu Mar 17 17:27:31 2005 正在连接 kunhua [IP=192.168.1.7:81]
Thu Mar 17 17:27:31 2005 已连接.
Thu Mar 17 17:27:31 2005 GET /test/yx/screen.vga HTTP/1.1
Thu Mar 17 17:27:31 2005 Host: kunhua:81
Thu Mar 17 17:27:31 2005 Accept: */*
Thu Mar 17 17:27:31 2005 Referer: http://www.mycodes.net/soft/2753.htm
Thu Mar 17 17:27:31 2005 User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)
Thu Mar 17 17:27:31 2005 Pragma: no-cache
Thu Mar 17 17:27:31 2005 Cache-Control: no-cache
Thu Mar 17 17:27:31 2005 Connection: close
Thu Mar 17 17:27:33 2005 HTTP/1.1 200 OK
//以上相同
Thu Mar 17 17:27:33 2005 Connection: close
Thu Mar 17 17:27:33 2005 Date: Thu, 17 Mar 2005 09:27:33 GMT
Thu Mar 17 17:27:33 2005 Server: Microsoft-IIS/6.0
Thu Mar 17 17:27:33 2005 X-AspNet-Version: 1.1.4322
Thu Mar 17 17:27:33 2005 Accept-Ranges: bytes
Thu Mar 17 17:27:33 2005 Cache-Control: public
Thu Mar 17 17:27:33 2005 Last-Modified: Thu, 10 Mar 2005 04:56:06 GMT
Thu Mar 17 17:27:33 2005 ETag: "1C5252D7795F700:1C52AD38B7E889E"
Thu Mar 17 17:27:33 2005 Content-Type: application/octet-stream
Thu Mar 17 17:27:33 2005 Content-Length: 30878343
Thu Mar 17 17:27:33 2005 开始接受数据!
Thu Mar 17 17:27:37 2005 User Cancel at 2756280.


应该就是服务器输出header的问题,可是我始终没有找出哪个header出了问题
...全文
56 点赞 收藏 3
写回复
3 条回复
skywatcher 2005年03月18日
Fri Mar 18 09:15:52 2005 HTTP/1.1 200 OK
Fri Mar 18 09:15:52 2005 Server: Microsoft-IIS/5.0
Fri Mar 18 09:15:52 2005 Date: Fri, 18 Mar 2005 01:21:46 GMT
Fri Mar 18 09:15:52 2005 X-Powered-By: ASP.NET
Fri Mar 18 09:15:52 2005 Connection: close
Fri Mar 18 09:15:52 2005 X-AspNet-Version: 1.1.4322
Fri Mar 18 09:15:52 2005 Accept-Ranges: bytes
Fri Mar 18 09:15:52 2005 Set-Cookie: ASP.NET_SessionId=52mcm245xpvkb045yfb5jf55; path=/
Fri Mar 18 09:15:52 2005 Last-Modified: Sat, 05 Mar 2005 19:54:52 GMT
Fri Mar 18 09:15:52 2005 Cache-Control: private
Fri Mar 18 09:15:52 2005 Content-Type: PowerCreator VGA File
Fri Mar 18 09:15:52 2005 Content-Length: 1021090


可是这样也还是不行阿,要不你再看看?
回复 点赞
saucer 2005年03月18日
if you change the content type, it should work, are you sure the MIME type is correct? not something like application/.... ?

Response.Clear();
Response.ContentType = ".......";
...write your file into the Response stream

Response.End();
回复 点赞
skywatcher 2005年03月17日
后来我将Content-Type: application/octet-stream改成Content-Type: PowerCreator VGA File也还是一样有问题
回复 点赞
发动态
发帖子
.NET技术社区
创建于2007-09-28

4.9w+

社区成员

66.8w+

社区内容

.NET技术交流专区
社区公告
暂无公告