开发者

Coldfusion Form Validation: File

I开发者_C百科n coldfusion how do you check if they choose a file to upload to the server? Isdefined won't tell if they specified a file or not.


<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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜