サイズを変更してサーバーに保存する前に、パス名と画像名のリストをループして、ファイルが存在し、jpg/pngであることを確認する必要があります。
私はこれを使いたい:
<cffile result="upload" action="upload" accept="image/jpeg, image/png" destination="#tempDirectory#" nameconflict="overwrite" />
<cfset testFilePath = tempDirectory & upload.serverFile>
<cfimage name="tempFile" action="read" source="#testFilePath#" />
<cfif NOT isImageFile( testFilePath ) >
<cfset fileDelete( testFilePath ) />
<cfthrow type="FileNotFound" message="#tx_settings_icons_error_img#" />
<cfelseif NOT listfindnocase(allow, upload.serverfileext) >
<cfset fileDelete( testFilePath ) />
<cfthrow type="FileNotFound" message="#tx_settings_icons_error_file#" />
</cfif>
しかし、私の問題は、次のようなパスからファイルをアップロードする方法がわからないことです。
http://www.some.com/folder/image.jpg
質問:画像
だけread
を作成し、検証を実行してからディスクに保存することはできますか、それとも最初に画像をアップロードする必要がありますか。500枚の画像のリストをループするcffile action="read"
必要があり、大きなファイルで読書を使用するべきではありません。isImage
画像ファイルのタイプとファイル拡張子が正しいかどうかを確認するための代替手段は何でしょうか?