Custom Module Class File Field

Delford Chaffin asked on October 1, 2014 22:11

I'm creating a custom module following this lesson from the docs: https://docs.kentico.com/display/K81/Creating+custom+modules

In my module definition under Classes > [My Class] > Fields, I have a field defined as:

Field type: File Required: Checked Field is system: Checked Field Caption: File Form Control: Upload File Extensions: xls;xlsx

In my UI definition, there is a page that uses the New/Edit Object Page Template (and whose Code name starts with New... per the guide). The proper object type is also set under the Properties tab.

Now, the problem ...

When I create a new item through the UI, it enters all fields into the database table correctly, but for the file field, it inserts "00000000-0000-0000-0000-000000000000" and it doesn't seem to be uploading the file.

What am I missing here? Is there something else I need to do to make this work?

Thanks!

Recent Answers


Delford Chaffin answered on October 1, 2014 23:14

Changing the file field to a text field and using the Media Library seems to work, so I think I'll go that way.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on October 2, 2014 01:06

I typically use a text field with a URL selector. This way you can choose from a doc attachment, content, media library, or web.

0 votesVote for this answer Mark as a Correct answer

Yehuda Lando answered on October 2, 2014 13:24

You can use meta fiels for this. And then you also have to specify HasMetaFiles = true in the type info.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.