Using the Util class

The Image, PDF, and Mail services typically act on a file that has been uploaded to the server. To upload the file to your CF server, use the Util class to run the ColdFusion Upload service. The Util class consists of two elements:

  • The UPLOAD_URL constant contains the URL on the ColdFusion server of the Upload service, relative to cf_webroot.

  • The extractURLFromUploadResponse() method takes response returned by the Upload service as input and returns the path of the uploaded file on the ColdFusion server.

You use the UPLOAD_URL constant and the extractURLFromUploadResponse() function in the following workflow to upload a file and use the file in a ColdFusion service.