[求助]关于LeadBBS无组件上传文件的一大问题?

almims 2007-02-08 10:45:40
上传功能在07年2月1号还是可以用的,但从2月2号一直到现在都不能进行文件上传!

然后找到了一定的原因!原因是当提交上传后,一直无法获取到文件名!

For Each formName in FileUp.file

Next

程序始终没法执行到循环内部,就说明文件名无法获取到!
请问各位这是什么原因导致的!
我想这好比是提交表单时,无法用Request获取到表单值一样!

[em10][COLOR=red]声明:[/COLOR]上传表单设置是正确的,向来都未曾改过
enctype="multipart/form-data" method="post"


[COLOR=red]以下是无组上传的从获取文件到文件上传的过程:[/COLOR]

Function Upload_NoComponent
On Error Resume Next
Dim formName,file
set FileUp = new UpFile_Class
If CheckSupervisorUserName = 1 and DEF_FileMaxBytes < 1024000 Then
FileUp.GetData (DEF_FileMaxBytes)
Else
FileUp.GetData (DEF_FileMaxBytes)
End If

If FileUp.err > 0 then
Select Case FileUp.err
Case 1
Response.Write "请先选择你要上传的文件 [ <a href=#3234 onclick=history.go(-1)>重新上传</a> ]"
Case 2
Response.Write "图片大小超过了限制 " & DEF_FileMaxBytes & "K [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
End Select
Exit Function
Else
For Each formName in FileUp.file ''列出所有上传了的文件
Set file = FileUp.file(formName) ''生成一个文件对象
If file.filesize<1 then
Response.write "请先选择你要上传的文件 [ <a href=#s334 onclick=history.go(-1)>重新上传</a> ]"
Response.End
End if

NewFileName="." & LCase(file.FileExt)
If inStr(":.jpg:.gif:.jpeg:.png:",":" & NewFileName & ":") = 0 then
Response.Write "文件格式不正确 [ <a href=#3333 onclick=history.go(-1)>重新上传</a> ]"
Response.End
End If

Pic_Name1 = GetSaveFileName(NewFileName)
UploadPhotoUrl2 = UploadPhotoUrl & Pic_Name2
UploadPhotoUrl = UploadPhotoUrl & Pic_Name1
Pic_Name = Pic_Name1

If file.FileSize>0 then
file.SaveToFile PhotoDir & Pic_Name
End If
Set File = Nothing
Next
Set FileUp = Nothing
End If
End Function
...全文
189 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
almims 2007-02-08
  • 打赏
  • 举报
回复
非常感谢 superrzb(程忠耿) 给的提醒!
注释掉了on error resume next 就看到了错误的存在!

原因是和request.form冲突了!问题已解决!

分数一定要给你!
almims 2007-02-08
  • 打赏
  • 举报
回复
好的!
superrzb 2007-02-08
  • 打赏
  • 举报
回复
调试时,请lz先注释on error resume next,再看出现什么错误提示。

28,391

社区成员

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

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