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
请各位大侠帮我看看呀!
查看全文
相关阅读:
git 好文引流
无法访问Swagger 或 druid面板无法访问 #报异常
MachineLearning入门-7(数据理解)
MachineLearning入门-6(数据导入)
MachineLearning入门-5(Python和Scipy简介)
百度PaddlePaddle入门-10(数据处理)
百度PaddlePaddle入门-9(建模)
百度PaddlePaddle入门-8(模型探讨)
MachineLearning入门-4(理解数据集)
百度PaddlePaddle入门-7 (Numpy的应用)
原文地址:https://www.cnblogs.com/aowind/p/107810.html
最新文章
The method getTextContent() is undefined for the type Node 的解决办法(eclipse)
web 项目重复加载的解决办法
linux 和windows下合并文件
winform 打包部署
C#多线程实践——创建和开始使用
C#多线程实践——线程同步
C#多线程实践——锁和线程安全
sql事务(Transaction)用法介绍及回滚实例
asp.net 登陆验证 Form表单验证的3种方式 FormsAuthentication.SetAuthCookie;FormsAuthentication.RedirectFromLoginPage;FormsAuthenticationTicket
【ASP.NET 基础】ASP.NET内置对象
热门文章
【ASP.NET 基础】表单和控件
【ASP.NET 基础】Page类和回调技术
Sql时间函数
jenkin 镜像构建错误 INFO: Retrying request to {}->unix://localhost:80 org.apache.maven.plugin.MojoExecutionException: Could not build image
Win开机自启目录
su 认证失败
rpm install show 错误:依赖检测失败:
Linux防火墙使用
KDE触摸板 桌面无法右击
org.springframework.beans.factory.BeanCreationException:
Copyright © 2011-2022 走看看