The MediaFileNames function

The MediaFileNames function returns the names of the files uploaded to a Media Upload widget as a semicolon-delimited list.

If your wrap requires a PDF file to be uploaded, it may be useful to validate that a PDF file is indeed attached to the corresponding Media Upload widget before you allow the wrap to be signed.

The MediaFileNames function returns a list of the file names uploaded to a particular Media Upload widget. You can then test for the occurrence of an expected file name or file type.

=IF(ISERROR(SEARCH(".PDF",upload_docs)),FALSE,TRUE)

The function above tests for the expected file type within the Media Upload widget using the Search function which is case-insensitive. If the string is not found, the Search function generates a #VALUE! error, which we catch with the ISERROR function. If the string is found, the formula above returns TRUE, which could be one of the required conditions before you enable the wrap to be signed.

The filenames in the list may not exactly match the original names.

  • The case is preserved, e.g. iPhone.jpg is saved as iPhone.jpg.
  • All characters except a-z and A-Z are replaced by underscores. This also affects whitespace, e.g. as file called Progress chart(24).png is saved as Progress_chart_24_.png.

Function reference

Example

=MediaFileNames(parcel_photos)

In the example above, there is a Media Upload widget in the cell parcel_photos. If this widget has two uploaded files called 11696754_front.jpg and 11696754_top.jpg, the MediaFileNames function would return

11696754_front.jpg;11696754_top.jpg

Format and parameters

=MediaFileNames(media_upload_cell)

The MediaFileNames function returns the names of the files uploaded to a Media Upload widget as a semicolon-delimited list. The order of the file names in the list is unpredictable. The use of upper- or lowercase letters is preserved. All characters except a-z and A-Z are replaced by underscores.

If you point the function at a cell that does not contain a Media Upload widget, or a Media Upload widget without any uploaded files, an empty string is returned.

media_upload_cell

Enter the cell name or cell reference for the Media Upload widget you want to test.