2 Replies Latest reply on Sep 18, 2007 12:43 AM by BKBK

    Using cfimage to reduce file size

    pbk-nFjYI4
      I want my site's users to upload their photos. If the user tries to upload a file over 100kb, I want to use the Quality attribute of cfimage to reduce the size to 100kb. To do this, do I first have to upload the file with <cfimage action="write" destination=[myserver]>, and then use <cfimage quality=[x]" to overwrite this file? Or can I resize the temp file BEFORE uploading it to my server?

      Thanks.
        • 1. Re: Using cfimage to reduce file size
          Stressed_Simon Level 1
          If you think it through it is obvious that this is not possible with ColdFusion. It is a server-side technology so cannot do anything to it before it gets to your server, in fact when using <cffile action="upload"....../> the web server actually handles the upload and cf just takes over when the temporary file is created.

          To do what you wanted would have to be done with some sort of applet embedded in the web page.
          • 2. Re: Using cfimage to reduce file size
            BKBK Adobe Community Professional & MVP
            To do this, do I first have to upload the file with <cfimage action="write" destination=[myserver]>, and then use <cfimage quality=[x]" to overwrite this file? Or can I resize the temp file BEFORE uploading it to my server?

            to upload: <cffile action="upload">
            to resize: <cfimage action="resize">