contentbox.models.util

Class ContentUtil

lucee.Component
    extended by contentbox.models.util.ContentUtil
Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    string getFileMimeType(string extension)
         Get's the file mime type for a given file extension.
    void sendFile([any file=''], [string name=''], [string mimeType=''], [string disposition='attachment'], [boolean abortAtEnd='false'], [string extension=''], [string deleteFile='false'])
         Send a file to the browser.
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    getFileMimeType

    public string getFileMimeType(string extension)

    Get's the file mime type for a given file extension

    Parameters:
    extension - e.g. jpg or gif

    sendFile

    public void sendFile([any file=''], [string name=''], [string mimeType=''], [string disposition='attachment'], [boolean abortAtEnd='false'], [string extension=''], [string deleteFile='false'])

    Send a file to the browser

    Parameters:
    file - The absolute path to the file or a binary file
    name - The name to send the file to the browser. If not sent in, it will use the name of the file or a UUID for a binary file
    mimeType - A valid mime type to use. If not sent in, we will try to use a default one according to file extension
    disposition - The browser content disposition (attachment/inline)
    abortAtEnd - Do an abort after content sending
    extension - Only used if file is binary. e.g. jpg or gif
    deleteFile - Delete the file after sending. Only used if file is not binary