Need example for file upload by user along with metadata

I am looking for example where I can build a workshop app where user can fill up a form and upload a file as well. Once clicks the upload button it shall upload the file to a media set (it would be a pdf or xml file) and add the data from form and media set ID to an ontology that I can refer later . Any examples ?

Do you need the PDF or XML file to be uploaded to a media set or can it just be an attachment on the newly created object?

If the latter would suffice, you can create an extra string column in the backing dataset (which initially has null values) and then change the mapped property’s base type to Attachment. In the action form for your “Create” new object action, the attachment property will permit file upload. The actual value stored will be the RID of the attachment in the backend blob storage. See below for example:

1. Create Empty Backing Dataset

2. Create Object Type + Configure Base Type of Relevant Property to be Attachment

3. Action Form in your ‘Create’ Action Type will permit File Upload

4. Display attachments using Workshop widgets (or just click on the hyperlink in the property list widget)

5. (Optional) Materialization stores an actual RID value that points to where the uploaded file is stored in blob storage

Thanks for your suggestion. I would like to upload it to a media set as I don’t want to upload the attachment inside ontology

In that case, you can use the Media Uploader widget in Workshop. The widget will appear as a button and will allow a user to upload a file (you can specify allowed file extensions so that an error can be thrown if a user tries to upload something unexpected).

Once that’s uploaded, you can store the RID that gets created for the uploaded file in a string variable (see OUTPUT section at the bottom of the widget’s configuration panel) and then also have an action form pop up. If you pass in the RID variable as a parameter default, you’ll be able to store it in whatever object type you want and have configured on your action.

Hi again
This part I got it working . Now I want to store this rid and other information from a form in an ontology. Goal is after uploading file with user provided metadata , they can view the table with all uploaded files in workshop , click the mediaset viewer if needed, or even update the mediaset object

For this, do you already have an object type with an associated “Create new object” action type? If not, that’s where to start. On your workshop, you can add a regular Button group widget button that triggers the action type, and a form will appear (you can configure how the form looks from the Ontology Manager).

In the same workshop, you can have an Object table widget whose input object set variable is all objects of the same object type (maybe sorted in descending order so you see the most recently created objects + which file it is). Another Workshop widget that would be useful to add is the Media preview widget. Based on the object/row in the object table that a user has selected, you can extract the RID of the associated uploaded file and view it directly from the Workshop module.

Thanks again. I was trying to avoid using ontology for a reason. Looks like I can’t avoid it . I will try it out