Coldfusion Form验证:文件

时间:2010-11-08 23:19:20

标签: html coldfusion adobe validation

在coldfusion中,您如何检查他们是否选择要上传到服务器的文件? Isdefined不会告诉他们是否指定了文件。

1 个答案:

答案 0 :(得分:6)

<form enctype="multipart/form-data" method="post">
    <input name="file" type="file">
    <input type="submit">
</form>

<cfif structKeyExists(FORM, "file") AND len(FORM.file)>
      You have chosen a file to upload to the server.
<cfelse>
      You have NOT chosen a file to upload to the server.
</cfif>