我可以将Coldfusions cffile action ="upload"与图像目标网址一起使用吗?

fre*_*ent 0 coldfusion verification file-upload cffile

在更改文件大小并将其存储到服务器之前,我需要循环遍历路径名和图像名称列表并验证文件是否存在并且是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>
Run Code Online (Sandbox Code Playgroud)

但我的问题是,我不知道如何从路径上传文件

 http://www.some.com/folder/image.jpg
Run Code Online (Sandbox Code Playgroud)

问题:
我可以只是read图像,执行验证然后存储到磁盘,还是我需要先上传图像.我将不得不遍历500个图像的列表,我cffile action="read"不应该使用大文件.检查图像文件的正确类型isImage和文件扩展名的替代方法是什么?

Dan*_*ort 5

我通常cfhttp用来读取图像并验证我有它,然后转换为有效的cfimage对象然后进行操作.你可以在这个问题的答案中看到我的过程.