我已成功将一些图像上传到服务器。我的问题是我不知道如何检索图像。如何在我的服务器上显示上传的图像?
我想我想创建一个显示这些图像的 Word 文档。有什么帮助吗?
<!--- Set Directory Name --->
<cfset dirName = Mid(noFailPemohon,17,7)>
<cfset variables.namaGambar1 = '' />
<cfset variables.namaGambar2 = '' />
<!--- Parameter --->
<cfparam name="filePath" default="C:\inetpub\wwwroot\SPPV2\03_Teknikal\upload\#dirName#\">
<cfparam name="filePath2" default="C:\inetpub\wwwroot\SPPV2\03_Teknikal\upload\PelanRumah\">
<!--- Create Dir If Not Exist --->
<cfif not DirectoryExists('C:\inetpub\wwwroot\SPPV2\03_Teknikal\upload\#dirName#\')>
<cfdirectory directory= "C:\inetpub\wwwroot\SPPV2\03_Teknikal\upload\#dirName#\" action="create">
</cfif>
<cfif not DirectoryExists('C:\inetpub\wwwroot\SPPV2\03_Teknikal\upload\PelanRumah\')>
<cfdirectory directory= "C:\inetpub\wwwroot\SPPV2\03_Teknikal\upload\PelanRumah\" action="create">
</cfif>
<!--- Upload Gambar1 --->
<cfif isDefined("Form.gambar1")>
<cftry>
<!--- Upload To Server --->
<cffile action="upload"
filefield="Form.gambar1"
destination="#filePath#"
nameconflict="overwrite"
result="status">
<!--- Rename File --->
<cftry>
<cffile action="rename"
source="#filePath##status.clientFile#"
destination="#filePath#GambarLaporan#VISIT_NUMBER#.#status.clientFileExt#">
<cfcatch type="any">
</cfcatch>
</cftry>
<cfcatch type="any"></cfcatch>
</cftry>
<cfset variables.namaGambar1 = "#status.serverdirectory#\#status.serverfile#" >
</cfif>