<!--#include file="../../lib/base.asp"-->
<!--#include file="../../lib/class/eycms.upload.asp"-->
<%
on error resume Next
dim upload
dim errstr:errstr=""
set upload=new eycms_upload
    upload.filetype=eycms.getsys("uptype_pic")
    upload.savepath=webroot&"plug/qrcode/"
    upload.savename="logo.png"
    upload.charset="utf-8"
    upload.maxsize=eycms.getsys("upmaxsize")
    upload.autosave=1
    upload.open()
    errstr=get_uploaderr(upload.form(upload.fileitem(1)&"_Err"))
set upload=nothing

if eycms.strlen(errstr)>0 then
    showmsg ""
else
    showmsg weburl&webroot&"plug/qrcode/logo.png"
End if

if err then
    eycms.errlog "文件：plug/qrcode/upload.asp<br>详情："&err.description,0
    err.clear
End if

function get_uploaderr(byval t0)
    dim t1:t1=""
    select case t0
        case -1:t1="没有文件上传"
        case 1:t1="文件过大，上传失败"
        case 2:t1="不允许被上传的文件"
        case 3:t1="文件过大，且不允许被上传"
        case 4:t1="文件保存失败"
        case 5:t1="禁止上传此类文件"
    end select
    get_uploaderr=t1
end function

sub showmsg(byval t0)
    dim htmlstr
    htmlstr="<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & vbcrlf & _
    "<HTML><HEAD>" & vbcrlf & _
    "<META content=""text/html; charset=utf-8"" http-equiv=Content-Type>" & vbcrlf
    if eycms.strlen(t0)>0 then
        htmlstr=htmlstr & "<SCRIPT type=text/javascript>parent.upload({""status"":1,""url"":"""& t0 &""",""msg"":""""})</SCRIPT>" & vbcrlf
    else
        htmlstr=htmlstr & "<SCRIPT type=text/javascript>parent.upload({""status"":0,""url"":"""",""msg"":""\u53ea\u652f\u6301jpg\u3001gif\u3001png\u3001bmp\u683c\u5f0f\u56fe\u7247\uff0c\u5e76\u4e14\u4e0d\u8d85\u8fc720M""})</SCRIPT>" & vbcrlf
    end if

    htmlstr=htmlstr & "<BODY></BODY></HTML>"
    eycms.echo htmlstr
end sub
%>




