图片上传问题,谁帮我!

来源:百度知道 编辑:UC知道 时间:2024/06/14 14:31:19
如何加上(上传文件类型限制)比如只可以上传jpg gif文件

是用化境无组件上传类的!

下面代码如何改:
<% Response.Write BH.ShowMsg(3,"","","")
End Sub

Sub Product_Save()
Server.ScriptTimeOut=5000
%>
<!--#include file="../inc/upload.inc"-->
<% Dim FieldName(9),FieldValue(9),ID,strResult,Upload

FieldName(0) = "ProductClassID"
FieldName(1) = "productname"
FieldName(2) = "ProductSize"
FieldName(3) = "BigImg"
FieldName(4) = "SmallImg"
FieldName(5) = "PubTime"
FieldName(6) = "ProductStatus"
FieldName(8) = "ProductInfo"
FieldName(9) = "EngProductInfo"

Set Upload = New upload_5xsoft ''建立上传对象

ID = Upload.Form("ID")
If ID = "" Or Not IsNumeric(ID) Then ID = 0

FieldValue(0) = Upload.Form("ProductClassID&quo

Public Function Add()
Dim file
Select Case Upid
Case 1
Set file=Up.file("filesource")

'取得表单的内容已经文件的信息
FileName=file.filename
DateAndTime=Now()
FileSize=file.filesize
'大小转换成以K为单位
FileSize=formatnumber(FileSize/1024,2)

'判断有效性
If FileSize=0 And FileName="" Then
Call ShowError("请选择要上传的文件")
Exit Function
End If
If limFileSize>0 And CInt(FileSize)>LimFileSize Then
Call ShowError("文件大小超过限制,请上传不大于"&limFileSize&"K的文件")
Exit Function
End If

Extension=split(FileName,".")(ubound(split(FileName,".")))
'判断有效性
Extension=Lcase(Extension)
If InStr(limExtension,Extension)=0 Then
Call ShowError("该文件类型已经禁止上传")
Exit Function
End If
Category=up.Form("category"