The Media Upload widget

A wrap instance can have file attachments. The Media Upload widget allows your users to upload documents, images or streaming media into a wrap instance.

The Media Upload widget makes it possible to use wraps in document management solutions. Users can attach scanned or digital documents, photos, videos and any other files they want to store with the wrap instance.

Example: A Wrap is used to report problems with railway carriages. The Wrap contains a Media Upload widget that allows users to attach photos to each error report.

You can retrieve a list of the uploaded file names using the MediaFileNames function.

You can access the uploaded media files also from other wrap instances using the WrapLinkMedia widget.

The Media Upload widget is a visual guide that helps you insert a wrapupload() function into the current cell.

Insert a Media Upload widget

  1. Select the cell where you want the media upload field to appear.
  2. Switch to the WrapCreator ribbon and click on Insert Widget.
  3. Select the Media Upload widget on the Widget tab in the task pane.
  4. Enter the required parameters and press Apply.
  5. Verify that a =wrapupload() function has been inserted into the cell.
  6. Files can be previewed in the wrap so make sure the cell has adequate height and width.
  7. A maximum of 5 files can be uploaded at a time to minimise potential for timeout errors however the media upload container has no limit to the number of files it can contain.

Parameters

Screenahot of the Media Upload widget in a wrap

 

Cell Name

You must always name all input fields. It adds clarity to the spreadsheet but more importantly names the database column where each input field is saved. If you share the uploaded media with other wraps, their WrapLinkMedia widgets will link to this cell name.

File Extensions

The list should contain patterns that match all the filenames you accept for upload. Separate the patterns with semicolons.

Files that don’t match any of the patterns will be ignored.

You can use a leading wildcard, i.e. both “*.pdf” and “*doc.pdf” are valid filename patterns.

Certain file types are forbidden to ensure that users do not upload files that could harm the ExcelWraps environment:

  • Files containing vba macros like docm, dotm, xlsm, xltm, pptm, potm, doc, xls, ppt
  • Executable files like exe, jar, js, vb, vbs, vbe, cpl, cmd, com, bat, scr, reg
  • Installation files like msi, msp, inf
  • Archive files like zip, tar, gz, rar, 7z

Scroll Height

The height of the widget is 39 pixels by default. You may want to increase the height if many files are expected to be added, to make room for all the file icons.

Known issues

Documents are protected by user roles

An additional layer of security is wrapped around any document uploaded. To view an uploaded document, you must have the correct role permission. Even if you know the file location on the server, you cannot access a document unless you have the correct role permission for it.

Remove a Media Upload widget

To delete a field, widget, wrap function or signature that has been stored at least once in the live production database is not a trivial task. The instructions below are only applicable during the initial development of a wrap, before it has ever been used in production. Read more about making changes to your wraps.

To remove a Media Upload widget:

  1. Ensure that the task pane is visible.
  2. Select the widget’s cell.
  3. The task pane should now show the Media Upload widget’s settings on the Cell tab. If it doesn’t, you may have selected the wrong cell, or already removed the widget by mistake.
  4. Locate the Remove button at the bottom of the widget settings and click on it.

Function reference

 

Screenshot of the Media Upload widget used for images only

Example

In the example above, the Media Upload widget lets the user upload a few common file types for images with each wrap instance.

Files can be previewed in the wrap so make sure the Media Widget’s cell has adequate height and width. The height of the Media Upload widget itself is set to 52 pixels.

The following cell formula is inserted into the cell.

=@WRAPUPLOAD("*.gif;*.jpg;*.png;*.webp", 52)

Format and parameters

=WRAPUPLOAD("filename_patterns", scroll_height)

“filename_patterns”

A list of patterns that match all the filenames you accept for upload. Enclose the list in quotes and separate the patterns with semicolons. For details, read more under Parameters above.

scroll_height

The height of the widget is 39 pixels by default. You may want to increase the height if many files are expected to be added, to make room for all the file icons.

The WRAPUPLOAD() function must be the only function in the Excel formula and it cannot be nested with another Excel function.