Upload/Download files and images in MDriven Turnkey
This page was created by Denis on 2020-11-24. Last edited by Stephanie@mdriven.net on 2025-02-03.

Upload/Download files

To upload files into your Turnkey application you should add an attribute with type of Blob to your class in the model.

You can set it in the attribute properties area in MDriven Designer.

Set the attribute's type and BlobType in attribute proeprties.

MDriven Turnkey will render Blob as the upload button component. Text inside the button depends on your ViewColumn name. Don't forget to use <MyColumn>_FileName and <MyColumn>_ContentType to save your name and content type of the uploaded file (Turnkey will use this information to download file correctly).

Upload file.png Default upload button
Upload file readonly.png Readonly state of upload button
Uploaded file.png Uploaded state of upload button

To upload images into your Turnkey application you should create an attribute with type of Blob and choose BlobType – "Image" in the properties of the attribute.

Setting BlobType to "Image" in MDriven Designer

In this case MDriven Turnkey will render it as the default image upload component.

Default view of image upload component

To upload an image you need to click on this button and choose the image which you want to upload.

Image upload component hover state.png

After your image is uploaded you will see it instead of upload button.

Uploaded image