zoukankan
html css js c++ java
有关文件上传存储的问题
代码如下
<
%@ Page Language
=
"
vb
"
Debug
=
"
true
"
%
>
<
html
>
<
script language
=
"
vb
"
runat
=
server
>
Sub uploadfile()
sub
uploadfile(sender
as
object
, e
as
system.Eventargs)
dim
s
as
string
s
=
"
d:\updata\
"
&
system.io.path.getfilename(butimage.postedfile.filename)
butimage.postedfile.saveas(s)
end sub
</
script
>
<
body
>
<
form runat
=
"
server
"
enctype
=
"
multipart/form-data
"
>
<
input
type
=
file runat
=
server id
=
butimage
/><
br
>
<
input
type
=
button id
=
yesbutton onserverclick
=
uploadfile runat
=
server value
=
"
提交
"
/>
</
form
>
</
body
>
</
html
>
运行后出现问题如下:
“
/
fileup”应用程序中的服务器错误。
--------------------------------------------------------------------------------
未找到路径“d:
\
updata
\
boat.gif”的一部分。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.IO.DirectoryNotFoundException: 未找到路径“d:
\
updata
\
boat.gif”的一部分。
源错误:
行
7
:
dim
s
as
string
行
8
: s
=
"
d:\updata\
"
&
system.io.path.getfilename(butimage.postedfile.filename)
行
9
: butimage.postedfile.saveas(s)
行
10
:
行
11
:
end sub
源文件: c:
\
inetpub
\
wwwroot
\
fileup
\
index.aspx 行:
9
堆栈跟踪:
[DirectoryNotFoundException: 未找到路径“d:
\
updata
\
boat.gif”的一部分。]
System.IO.__Error.WinIOError(Int32 errorCode,
String
str
)
+
287
System.IO.FileStream..ctor(
String
path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize,
Boolean
useAsync,
String
msgPath,
Boolean
bFromProxy)
+
888
System.IO.FileStream..ctor(
String
path, FileMode mode)
+
52
System.Web.HttpPostedFile.SaveAs(
String
filename)
+
48
ASP.index_aspx.uploadfile(
Object
sender, EventArgs e)
in
c:
\
inetpub
\
wwwroot
\
fileup
\
index.aspx:
9
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)
+
108
System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(
String
eventArgument)
+
57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String
eventArgument)
+
18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+
138
System.Web.UI.Page.ProcessRequestMain()
+
1277
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:
1.1
.
4322.573
; ASP.NET 版本:
1.1
.
4322.573
请各位大侠帮我看看呀!
查看全文
相关阅读:
不会全排列算法(Javascript实现),我教你呀!
驰骋页面,谁主沉浮-也谈清除浮动
你不知道的parseInt
Javascript函数重载,存在呢—还是存在呢?
在这个看脸的世界,该如何优雅的创建JS对象
Python 函数的使用小结
Python 集合(set)的使用总结
Python 文件操作
python 中字典的操作(增、删、改、查)
python 中list的操作(循环、切片、增、删、改、查、反转、排序)
原文地址:https://www.cnblogs.com/aowind/p/107810.html
最新文章
【Hadoop】namenode与secondarynamenode的checkpoint合并元数据
【Hadoop】hdfs,剖析文件上传
LeetCode142:Linked List Cycle II
LeetCode143:Reorder List
LeetCode144:Binary Tree Preorder Traversal
LeetCode145:Binary Tree Postorder Traversal
LeetCode146:LRU Cache
LeetCode147:Insertion Sort List
LeetCode148:Sort List
LeetCode150:Evaluate Reverse Polish Notation
热门文章
LeetCode151:Reverse Words in a String
LeetCode149:Max Points on a Line
再探JS数组原生方法—没想到你是这样的数组
前端Js跨域方法汇总—剪不断,理还乱,是跨域
网页整体布局完全剖析—剖完你不进来看一下么?
HTML5和CSS3新特性一览
你不知道的this—JS异步编程中的this
常用正则表达式—想说爱你不容易
Borland C++建立工程菜鸟教程
一起又双叒叕看数组去重—我有一千种方法让妳成为我的唯一
Copyright © 2011-2022 走看看