在数据库中使用上载控件存储imgae路径 [英] using Upload control store imgae path in database

查看:81
本文介绍了在数据库中使用上载控件存储imgae路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FileUpload1.SaveAs(@"D:\ ....... \ Business \ images \ Upload \" + FileUpload1.FileName);

所以
我想要http://localhost/......../Upload/aaa.gif

FileUpload1.SaveAs(@"D:\.......\Business\images\Upload\" + FileUpload1.FileName);

so
i want like http://localhost/......../Upload/aaa.gif

推荐答案

您无法保存到URL,您需要保存到本地文件系统.您可以使用Server.MapPath从本地文件路径获取URL,并将其存储在数据库中.
You cna''t save to a URL, you need to save to the local file system. You can use Server.MapPath to get the URL from the local file path, to store in your DB.


这篇关于在数据库中使用上载控件存储imgae路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆