asp用FSO将客户端excel文件上传到服务器,然后将上传的文件导入数据库,最后删除文件(急)

ringking007 2005-12-21 12:17:58
asp用FSO将客户端excel文件上传到服务器,然后将上传的文件导入数据库,最后删除文件
请提供源码.....
导入数据库部分不用了,只需提供用FSO将客户端excel文件上传到服务器,然后删除文件
谢谢
...全文
242 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhanghongwen 2005-12-21
  • 打赏
  • 举报
回复
UP
xtuwz 2005-12-21
  • 打赏
  • 举报
回复
jspadmin兄樂於助人呀,呵呵
jspadmin 2005-12-21
  • 打赏
  • 举报
回复
<%
fname="index.htm"
fpath=Server.MapPath("test")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.DeleteFile(fPath & "\" & fname)
Set fso = Nothing
response.write "文件删除成功!"
%>
jspadmin 2005-12-21
  • 打赏
  • 举报
回复
<html>
<form name="frmReadFile" method="post" action="savetoserver.asp">
文件的内容为:
<%
'飞云编写
'可以自由引用修改,但是请注明出处或保留链接
'我的个人站点http://www.pifoo.com
'QQ33323489
set fso=CreateObject("Scripting.FileSystemObject")
set hFile=fso.OpenTextfile("Autoexec.bat")
sFileContent=hFile.Readall() '读取文件内容
sEditControl="<TextArea name=""FileContent"">" & sFileContent & "</TextArea>"
response.write(sEditControl) '构造,并显示一个文本框
set hFile=nothing
set fso=nothing
%>
<input type="submit" name="btnSubmit" value="提交">
</form>
读取客户端文件成功!
</html>


<%
a=request.form("FileContent")
fname="1.txt"
fpath=Server.MapPath(".")
set fso=server.createobject("scripting.filesystemobject")
set mytxt=fso.createtextfile(fPath & "\" & fname,true,false)
mytxt.write a
mytxt.close
response.write "写入服务器成功!<br>"
set mytxt=nothing
set fso=nothing
%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧