[提问]
Windows主机ASPupload上传代码
|
|
各位朋友们!
几个月前一个关于ASPupload上传的问题仍未解决,今天给GD客服发了邮件,翻译过来看了一下,也没搞清问题所在,请有经验的朋友或版主提供一段标准的ASPupload上传代码,只需基本功能即可,表单中一个text字段,一个file字段,上传程序要可以判断文件类型和重命名文件。
我得到的GD回复邮件内容如下:
This application is included with your hosting account. There's no need to install or activate these components. You can use this as soon as your hosting account is set up.
AspUpload 3.0
With AspUpload 3.0, you can use your ASP application to capture, save, and process files uploaded with a Web browser.
We have limited support on the scripting necessary to make this component run. You will want to review the above website ASPUpload for more information. If you are still having issues uploading your content and it is not a scripting issue but a possible issue with our servers, please provide us the steps necessary to duplicate the issue. |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2010-7-5 17:36:38
|
显示全部楼层
|
参考这个呢 http://bbs.idcspy.com/thread-22735-1-1.html |
|
|
|
|
|
|
|
|
|
|
lsok
发表于 2010-7-5 17:44:11
|
显示全部楼层
多谢,但我参考了N遍也没解决,我的代码思路极简单,甚至可以说很笨,但在国内服务器正常。代码如下:
Set upload = Server.CreateObject("persits.upload.1") '创建Upload对象
count=Upload.save() '将上传的文件保存至服务器内存,count是获得上传的文件数
yao=upload.form("yaoqiu") '获取上传表单中文本域的值
if count<1 then '判断是否上传了文件,如果上传文件域的值为空,则
rs.addnew
rs("yaoqiu")=yao
rs("itemren")=session("username")
rs("itemtime")=now()
rs.update
response.write"<script>alert('提交成功!');window.location.href='itemlist.asp';</script>"
else
Set file1 = Upload.Files("file1") '创建file对象并获取上传表单中文件域的值
houzhui=file1.Ext '获取上传文件的后缀
if houzhui =".gif" or houzhui=".jpg" or houzhui=".png" or houzhui=".psd" or houzhui=".rar" or houzhui=".doc" or houzhui=".txt" then
newname = year(now()) & month(now()) & day(now()) & hour(now()) & minute(now()) & second(now()) '重命名上传的文件
file1.SaveVirtual("upload") & "\" & newname & houzhui ‘保存文件
这最后一行报错,意思应该是对象不支持file.savevirtual方法或属性。 |
|
|
|
|
|
|
|
|
|
|
lsok
发表于 2010-7-5 19:48:11
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
lsok
发表于 2010-7-6 15:02:32
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
lsok
发表于 2010-7-6 15:56:09
|
显示全部楼层
|
求一段能在godaddy空间正常工作的ASP上传代码。 |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2010-7-6 16:06:37
|
显示全部楼层
|
|
|
|
|
|
|
|