标题:在form中加了enctype=multipart/form-data,text的值就取不出来了,怎么解决 ...
取消只看楼主
linux2004
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2010-4-8
结帖率:0
 问题点数:0 回复次数:3 
在form中加了enctype=multipart/form-data,text的值就取不出来了,怎么解决啊,谢谢
<!--#include file="conn.asp"-->
<!--#include file="upload_inc.asp"-->
<%

'上传图片*********************************************************
IDstring=session("id")&date & time         '图片文件名
IDstring=Replace(IDstring,"-","")
IDstring=Replace(IDstring,":","")
pthString="gg_images/"
set upload=new upload_5xsoft
imgLink=replace(trim(upload.Form("imgLink")),"'","’")
set file=upload.file("imgUrl")
if file.filesize>0 then
if file.filesize>2097152 then
set file=nothing
response.write("<script>alert('上传图片的大小不能大于2M,即:2097152字节!');history.back(1);</script>")
else
FileTpe=Mid(file.filename,Len(file.filename)-2)
if not (ucase(fileTpe)="JPG" or ucase(fileTpe)="BMP" or ucase(fileTpe)="GIF") then
response.write("<script>alert('上传图片格式只能为:JPG,BMP,GIF。');history.back(1);</script>")
else
file.saveAs Server.mappath(pthString & IDstring & "." & FileTpe)
filepath=IDstring & "." & FileTpe
end if
end if
else
filepath=""
end if
set file=nothing
'上传结束*********************************************************

set rs=server.createobject("adodb.recordset")
rs.open "select * from [gg_pic]",conn,1,3
rs.addnew
rs("imgUrl")=filepath
rs("imgLink")=imgLink
rs.update
rs.close
set rs=nothing
set upload=nothing
response.Write "<script language=javascript>alert('添加成功!');window.location.href='admin_gg_edit.asp'</script>"
%>


图片可以上传,文件名可以取得,就是imgLink=replace(trim(upload.Form("imgLink")),"'","’")的值取不到,麻烦指点一下,谢谢了
搜索更多相关主题的帖子: 上传图片 
2011-04-13 12:40
linux2004
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2010-4-8
得分:0 
我没用Request取值啊,我是用upload.Form取的值,但是还是没有值
2011-04-13 17:03
linux2004
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2010-4-8
得分:0 
Ad_Manage.rar (745 KB)


谢谢
2011-04-13 21:38
linux2004
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2010-4-8
得分:0 
我试试,谢谢
2011-04-15 18:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-336515-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.089999 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved