在coldfusion中,您如何检查他们是否选择要上传到服务器的文件? Isdefined不会告诉他们是否指定了文件。
答案 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>