iMessageID is a variable initialized to the ID of the relevant Message object.
iFileName is a variable initialized to an appropriate full path and file name. You might find that Utilities.TempFiles provides a useful location (ie. path name) for your purposes.