查看: 1044|回复: 8
|
folderBrowserDialog in asp.net[已决解]
[复制链接]
|
|
请参考苦瓜汤的solution#7
------------------------------------------------------
如何download file from database using asp.net
小弟现在做到upload 东西到database,但关于如何下载它进我的电脑的local disc with pop up save as dialog
网上找了很久相关资料,找不到
请各位大大指教。。
[ 本帖最后由 心的太平洋 于 14-10-2008 01:51 PM 编辑 ] |
|
|
|
|
|
|
|
楼主 |
发表于 29-9-2008 10:43 AM
|
显示全部楼层
没人会吗?
头痛整个周末,帮帮忙
如何download/ save file from database |
|
|
|
|
|
|
|
发表于 29-9-2008 06:58 PM
|
显示全部楼层
Insert into BLOB
然后 直接用asp.net的image,set the src value.
or create a file to use header retrieve the blob and send as image. |
|
|
|
|
|
|
|
发表于 30-9-2008 10:27 PM
|
显示全部楼层
|
|
|
|
|
|
|
楼主 |
发表于 7-10-2008 10:35 AM
|
显示全部楼层
回复 4# JJ87 3#o1j2m3的帖子
谢谢你们的回复,我找到办法做到save to local disc 了
但现在在想着如何pop up folderBrowserDialog in ASP.NET
据我了解的是, folderBrowserDialog 只能用在window application,不能在web application 用的
**我做到的是user just download it into local disc, 但是那个path我已经define了,如:c:\\
现在要做的是:user click on a button call "select path ",按了就会出现 save as dialog,我要拿它的folder path
有没有可能做到呢?如用modul dialog?
请指教。。
[ 本帖最后由 心的太平洋 于 7-10-2008 10:44 AM 编辑 ] |
|
|
|
|
|
|
|
楼主 |
发表于 13-10-2008 03:32 PM
|
显示全部楼层
各位大大, 真的没idea吗?
为什么别的网站能的呢?
比如说,hyperlink "click here to download"
once 我们click on it ,就会pop up a msg box 说 where to save/ save as
我就是要做这样的。。
谢谢。。 |
|
|
|
|
|
|
|
发表于 13-10-2008 07:54 PM
|
显示全部楼层
1. Clear掉HTTP Headers
Response.ClearHeaders();
2. 告诉Browser你的File是什么Type
Response.ContentType = "image/gif";
3. 告诉Browser要prompt save as dialog
Response.AddHeader("Content-Disposition", "attachment");
4. 用HttpResponse的Write或者是OutputStream把file content写入
Response.Write(data);
5. 告诉Browser你已经传输完毕
Response.End(); |
|
|
|
|
|
|
|
楼主 |
发表于 14-10-2008 01:35 PM
|
显示全部楼层
回复 7# 苦瓜汤 的帖子
收到!!
谢谢你, 苦瓜汤
做到了
但有个问题想请教你
after response.end();
我想做别的东西呢?
可以改回http吗? |
|
|
|
|
|
|
|
发表于 16-10-2008 09:43 PM
|
显示全部楼层
回复 8# 心的太平洋 的帖子
可以,不过当前的Response不能再output任何东西。 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|