100分加100RMB饭钱急求aspupload上传
大概样子在这里
http://www.maibenben.com/aspupload/addnormalcase.asp
文件下载
http://www.maibenben.com/aspupload/aspupload.rar
要求是实现用aspupload组件实现上传
1.实现图片用aspupload组件上传,现在已经实现了上传功能了,但是需要在upfile目录下把上传的文件用年月份的方式分文件价存储.现在分文件夹还没有实现.
2.把图片的相对路径及文件名存储到数据库里,格式例如2007_2_1/200722173916.gif
3.能够一次上传多个文件,并在在下面显示出文件的名称来,并且可以删除.这个现在已经实现session清除,但是没有实现服务器上FSO方式删除.
4,能够实现各个图片的解说和图片路径一同写进数据库.
5此外还有其他的表单数据,能够实现表单数据提交.
现在的设计实现是把多个图片上传到服务器上,并用 session区分记录信息,每一条数据用|隔开.
具体怎么样实现多个图片添到一个字段里,并且对应有说明,我现在脑袋都想大了,没有办法.
另外显示图片的时候要怎么样才能显示出图片和说明来,我也不清楚.
各位老大谁有方法啊?最好是详细点的例子,或者谁有时间帮我写一下,小弟感激不尽!~~~
要过年了,兄弟们帮帮忙吧!老板后天就要啊,晚了工钱又要扣干净了.
哪个达人解决了,我请吃饭啊!!!!
部分代码
<!--#include FILE= "inc_upfile.asp "-->
<%on error resume next%>
<meta http-equiv= "Content-Type " content= "text/html;charset=gb2312 ">
<link href= "/img/index.css " rel= "stylesheet " type= "text/css ">
<script language= "JavaScript " src= "../inc/header.js "> </script>
<%
dim act
act = request( "act ")
sub err_msg(message)%>
<script> alert( ' <%=message%> ');history.back(); </script>
<script> window.close(); </script>
<%response.End
end sub
select case act
case "up " '上传文件
if session( "AccessoriesList ") = Empty then
dim AccessoriesList
end if
dim fso,strDir,ftime,FileUp,FullPath,types
Set fso = Server.CreateObject( "Scripting.FileSystemObject ")
strDir= "./upfile/translation/ "& " "
if not fso.folderexists(Server.MapPath(strDir)) then fso.CreateFolder(Server.MapPath(strDir))
randomize
dim s
s = cstr(Int(Rnd()*(99999-10100+1))+10100)
ftime= " "&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now) & s & " "
set fso = nothing
FileName=now() '开始取文件名
FileName=replace(FileName, "- ", " ")
FileName=replace(FileName, ": ", " ")
FileName=replace(FileName, " ", " ")
FileName=FileName+rndNum(4)
On Error Resume Next
Set FileUP = Server.CreateObject( "Persits.Upload ")
FileUP.SetMaxSize 1000000, True
FileUP.Save
'if FileUP.TotalBytes = 0 then err_msg( "当前文件为空文件。 ")
Set File = FileUP.Files( "FILE ")
ext=LCase(right(file.ext,len(file.ext)-1))
if ext= " " then
err_msg( "当前文件为空文件。 ")
end if
FullPath= "./upfile/translation/ "
'types=mid(FullPath,InStrRev(FullPath, ". ")+1)
'types=LCase(types)
filename=filename+ ". "+ext
'File.SaveAs Server.mappath( " "&filename& " ")
File.SaveAs "K:\case\upfile\translation\ " & Filename
if session( "AccessoriesList ") <> " " then
session( "AccessoriesList ") = session( "AccessoriesList ") & "| "
end if
session( "AccessoriesList ") = session( "AccessoriesList ") &filename
case "delete " '删除文件
dim sfile,sfilename
sfile = request( "file ")
sfilename = server.mappath( "../upfile/translation ") & "\ " & sfile
set fso = Server.CreateObject( "Scripting.FileSystemObject ")
if fso.FileExists(sfilename) then
fso.DeleteFile sfilename
end if
File.DeleteFile "K:\case\upfile\translation "&FileName
set fso = nothing
session( "AccessoriesList ") = replace(session( "AccessoriesList "),sfile, " ")
session( "AccessoriesList ") = replace(session( "AccessoriesList "), "|| ", "| ")
end select%>
<body topmargin=0 rightmargin=0 leftmargin=0>
<form enctype= "multipart/form-data " method= "post " action= "upfile.asp?act=up " name= "form_up " onSubmit= "return checkform(); ">
<input name= "cmd " type= "hidden " value= "delete ">
<script language= "JavaScript ">
<!--//
function checkform()
{
if (ignoreSpaces(document.form_up.file.value)== " ")
{
alert( "没有选择欲上传的文件。 ");
document.form_up.file.focus();
return false;
}
}
function DeleteFile()
{
if (document.form_up.Accessories.options.length > 0)
if (confirm( "确定删除选定的附件“ " + document.form_up.Accessories.value + "”? "))
{
location.href= 'upfile.asp?act=delete&file= ' + document.form_up.Accessories.value;
}
}
//-->
</script>
<table cellpadding=0 cellspacing=0 width=100% class=a4>
<tr>
<td height= "30 ">
<input type=file name=file size=60 class= "editbox " style= "width:330; ">
<br>
图片说明: <input name= "file_info " type= "text " id= "file_info " size= "10 "> <br>
<input type= "submit " value= "上传 " name=Submit class= "button ">
</td>
</tr>
<tr>
<td height= "30 ">
<select name= "Accessories " id= "Accessories " class= "editbox " style= "width:150; ">
<%if act = "up " or act = "delete " or act = "modify " then
dim i
AccessoriesList = split(session( "AccessoriesList "), "| ")
for i = 0 to ubound(AccessoriesList)
if trim(AccessoriesList(i)) <> " " then%>
<option value= " <%=AccessoriesList(i)%> "> <%=AccessoriesList(i)%> </option>
<%end if
next
else
session.Contents.Remove( "AccessoriesList ")
end if%>
</select>
<input name= "Delete " type= "button " class= "button " id= "Delete " value= "删除 " onClick= "javascript:DeleteFile(); ">
</td>
</tr>
</table>
谢谢了
[解决办法]
看你的要求至多麻烦一点,但实现起来应该不会很难吧
[解决办法]
帮顶一个