关于the given path's format is not support的问题
来源:互联网 发布:房产销售软件 编辑:程序博客网 时间:2024/05/21 17:29
最近做一个网站,用fileupload上传图片到数据库,我的做法是先把文件保存到数据库,然后再用filestream进行相应的操作保存到数据库中。
但是在fileupload1.saveas(path)这里总是出错,提示the given path's format is not support。
我的路径设置时
string name=fileupload1.postfile.postname; //可能代码拼写有错误大家知道意思即可
string path = Server.MapPath("~/")+name;
我上网上查了查,大神们总是说路径出错,也没说到底怎么出错了,且这样的方式有个特点是,凡是装了visual stadio的电脑都可以正常上传。没有装的就会报错。
后来我发现 凡是装了 visual stadio 的电脑读取的name是***.jpg,而没有装vs的电脑读取的name是D:\***\***.jpg;就是因为这样的差别导致了有的电脑会报错。
大家只要用name值区分一下,不同的name,赋path不同的值,就解决问题了。
小弟第一次写博客,写的不好,大家别骂啊
- 关于the given path's format is not support的问题
- The given path's format is not supported
- 关于access to the path is denied问题的解决
- 关于access to the path is denied问题的解决
- 在ubuntu10.10中安装VMWare Tool,遇到The path " " is not valid 的问题
- 问题:Eclipse 提示 The given project is not a virtual component project
- 解决The project was not built since its build path is incomplete. Cannot find the class file的问题
- 解决php的“It is not safe to rely on the system’s timezone settings”问题
- 解决php的“It is not safe to rely on the system’s timezone settings”问题
- It is not safe to rely on the system's timezone settings. 的PHP问题处理
- 关于access to the path is denied问题的解决(路径被拒绝)
- 关于The server does not support version 3.0 of the J2EE Web module specification.问题的解决方案
- open_basedir restriction in effect. File() is not within the allowed path(s)
- 关于hadoop中The method XXXX is not applicable for the arguments问题的解决
- Check if the given binary tree is BST or not.
- The given project is not a virtual component project
- The given project is not a virtual component project
- The given project is not a virtual component project
- 浏览器
- python中字符串的使用
- java BigDecimal 对金额的一个处理!
- STL中vector、list、deque的区别
- HDOJ 1016 Prime Ring Problem(素数环 - 深搜)
- 关于the given path's format is not support的问题
- Epub 转 txt
- Android自定义控件超链接文本LinkTextView的实现
- 用 Octave 求解线性规划问题
- gridView动态添加列
- 自动机的一些算法和应用
- for 语句
- git ignore
- MySQL Internal 笔记