0

I would like to set up an image server. I would like the image server to allow http image uploads. How can I lock down the image server to only accept image uploads from forms on my other Cold Fusion servers?

user1594257
  • 487
  • 1
  • 4
  • 16
  • 1
    Use a secret token to verify that the upload is requested from your other server. –  Aug 22 '19 at 03:13
  • You could add ip restrictions to whatever web server you are using. If you’re using IIS, it’s under domain and IP restrictions. – Redtopia Aug 22 '19 at 04:38
  • If your upload is clientside, you need an auth/password system. If it's server to server, an IP restriction is the best way. Please edit your question to contain more details about what your actual goal is and what you tried to do so far. – Alex Aug 22 '19 at 10:52

1 Answers1

0
<cftry>
    <!--- Add more MIME types as required ( .gif, .tif etc ) --->
    <cfset variables.allowMimeTypes =  { 'image/jpeg': {extension: 'jpg'}, 'image/png': {extension: 'png'} } />
    <cffile action=""upload"" filefield=""image_ile"" destination=""#GetTempDirectory()#"" mode=""600""
            accept=""#StructKeyList(variables.allowMimeTypes)#"" strict=""true""
            nameconflict=""makeunique"" />

    <cfcatch type=""any"">
        <!--- Handle the error messages - Empty file (0 bytes file), Invalid MIME type or any other error --->
        <cfdump var=""#cfcatch#"" />
    </cfcatch>
</cftry>
MaartenDev
  • 5,631
  • 5
  • 21
  • 33
Sree Reddy
  • 126
  • 3