asp如何在上传图片指定路径文件夹的同时,传入数据库路径?
上传分为几个页面来的,所以你最好看完我写给你的东东,,你要仔细看。。。
这样你最好是加我百度HI,我用HI传给你,就两个文件。在这里说一大通,你可能还是不会明白。。。
这是上传第一个页面
上传课程:
点击上传 (允许格式为avi|wmv|mov|rm|rmvb|wma)
你看到那个NAME没?你在写入数据时,就把它写进去就可以了,你点那个点击上传,就会另外弹出一个小窗口页面,那个页面名就叫upfile。
htm,这一段你可以加到你想要加的地方
第二个页面:弹出小窗口进行上传的页面,也就是upfile。
htm页面
这个页面是让你选择上传文件来的,然后把你选择的文件一些值传到upfile_flash。
asp?id=id这个页面进行处理
最后第三个页面upfile_flash。asp,也就是处理页面了
文件上传
"" then
GuFolderPath=upload。
form("GuFolderPath")
call FolderNameCheck(GuFolderPath)
GuFolderPath=upload。form("GuFolderPath")
if right(GuFolderPath,1)"" then
GuFolderPath=GuFolder0
call FolderNameCheck(GuFolderPath)
GuFolderPath=GuFolder0
if right(GuFolderPath,1)0 then
dim FileExtF,FileExtY,FileExtOK,ii,jj
FileExtF=split(File。
FileName,"。")
for jj=0 to ubound(FileExtF)
next
FileExtY=0
FileExtOK=split(GuFileExt0,"|")
for ii=0 to ubound(FileExtOK)
if FileExtOK(ii)=FileExtF(jj-1) then
FileExtY=1
exit for
end if
next
if FileExtY=0 then
response。
Write "上传失败,不允许上传的文件类型"
elseif file。FileSize>GuFileSize0*1024 then
response。Write "上传失败,单个文件大小超过限制,最大"&GuFileSize0&"*1024 字节,1K=1024字节"
else
dim FileNameOK
if GuAutoName="1" then
FileNameOK=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&iCount&"。
"&FileExtF(jj-1)
else
FileNameOK=file。FileName
end if
file。SaveAs Server。
mappath(GuFolderPath&FileNameOK) '保存文件
dim pictext
'标题: upload。form("pictext")
'call savedata(file。
FileName,file。FileSize)
Response。write ""
'iCount=iCount 1
end if
else
response。
Write "上传失败,请选择要上传的文件"
end if
set file=nothing
next
set upload=nothing
'response。
Write "上传成功!"
Sub FolderNameCheck(FolderNameNew)
dim Letters,i,c
Letters=" =:;,[]0 then
Htmend "上传失败,文件夹名称含有特殊字符"
end if
next
GuFolderPath=server。
MapPath(GuFolderPath)
Set fso=Server。CreateObject("Scripting。FileSystemObject")
if fso。FolderExists(GuFolderPath)=false then
fso。
CreateFolder(GuFolderPath)
end if
Set fso=nothing
End sub
%>
这当中有一个很重要的地方,你一定要注意,就是在这一段中Response。
write ""
你看到有个zuoyeup没有?传值的名字来的,这个名字一定要与要写入数据的名字一样,不然,就无法将获取得到的图片地址传到第一个页面的框框中,反正你再看看上面第一个页面哪里有这个名字的,你要改名字的,这两个地方都要一样的名字就是了。
第四个,upload_5xsoft。inc页面内容
。
答:给文章配图片 新浪博客只支持上传.jpg和.gif两种图片格式 每张图片不能超过300Kb 网络上已经有的图片 需要先得到图片URL地址 点击 发表文章 点...详情>>
答:详情>>