どのようなドキュメントをお使いですか? <cffile action="upload">
この例では(私が編集した)、ユーザーが選択したファイルの名前を参照していないことを示しています。フォームフィールドの名前、fileContents
、これはファイルのアップロードに使用されます。
<!--- Windows Example --->
<!--- Check to see if the Form variable exists. --->
<cfif structKeyExists(Form, "FileContents") >
<!--- If TRUE, upload the file. --->
<cffile action = "upload"
fileField = "FileContents"
destination = "c:\files\upload\"
accept = "text/html"
nameConflict = "MakeUnique">
<cfelse>
<!--- If FALSE, show the Form. --->
<form method="post" action=<cfoutput>#cgi.script_name#</cfoutput>
name="uploadForm" enctype="multipart/form-data">
<input name="FileContents" type="file">
<input name="submit" type="submit" value="Upload File">
</form>
</cfif>
CFFILE
プロセスが完了すると、変数のコレクションは(ドキュメントリンクを参照してください)CFFILE
という名前の構造で定義されています。これらの変数の1つはcffile.clientFile
で、ユーザーのコンピュータからアップロードされたファイルの名前が含まれています。 cffileコマンドについては
あなたは例が含まれていませ見マニュアルを参照してましたか? –
ああ、彼らは何も説明しませんでした:fileField = "FileContents" - "FileContents"は何でしょうか? –