这是我的代码:
<cfif (CFFILE.FileSize GT (4194304))>
Delete File
<cfelseif CFFILE.serverFileExt neq "png" >
Delete File
<cfelse>
It's ok
</cfif>
我想添加“jpg”和“jpeg”作为允许的文件类型。我试过了,这没有成功。
<cfif (CFFILE.FileSize GT (4194304))>
Delete File
<cfelseif ( ( CFFILE.serverFileExt neq "png" ) OR ( CFFILE.serverFileExt neq "jpg" ) OR ( CFFILE.serverFileExt neq "jpeg" ) ) >
Delete File
<cfelse>
It's ok
</cfif>
有任何想法吗?
解决方案:
我的 OR 语句必须是 AND,谢谢 Miguel-F,并且随着 Busches 的改进,这是最终结果:
<cfif (CFFILE.FileSize GT (4194304))>
Delete File
<cfelseif NOT ListFindNoCase("jpg,jpeg,png", CFFILE.serverFileExt)>
Delete File
<cfelse>
It's ok
</cfif>
多谢你们!