How to find the file uploaded by DirectUploadControl

Ashutosh Pandey asked on May 15, 2021 16:00

We are using Kentico 10

Question 1

We are using DirectUploadControl to upload image in a page form.

We have column PDFImage in the page type. I can see the value of this field to be a GUID.

Where the image is stored on disk when uploaded by this control? Which table is updated with file name?

I tried the page type table, cms document and media file but couldn't find.

Question 2

We need to process the image when uploaded. Is there an event? Right now we are doing this in DocumentEvents.SaveVersion.After

Recent Answers


Juraj Ondrus answered on May 17, 2021 09:19

  1. This depends on how the system is set to store files. So, it can be in the DB or on disk or both. When on disk, it depends what folder is set to store the attachments.
  2. In the document events there is the SaveAttachment event - so maybe you can try using that one. Or, it might be better to create a custom uploader form control - depending on your needs.
0 votesVote for this answer Mark as a Correct answer

Ashutosh Pandey answered on May 21, 2021 13:52 (last edited on May 22, 2021 08:14)

Edit:

Can you please provide the table name where I can look for the uploaded file. Right now, the configuration is storing on disk. The directory is ~root/site-name/media

Thanks

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 21, 2021 14:22

Storing in files? I guess it is a typo. But the DB table for page attachments is called CMS_Attachments.

0 votesVote for this answer Mark as a Correct answer

Ashutosh Pandey answered on May 22, 2021 16:22 (last edited on May 23, 2021 10:59)

Hi, I may be bugging you but I'm not able to decipher this. For some pages, I find the uploaded file in

CMS_Attachment

table, for some other pages, I find the uploaded file in

CMS_AttachmentHistory

and sometimes I don't see the uploaded file entry in both the tables. I'm confused now why this is hapenning. I can see the file in the Form (on page) in all the cases.

Also, for all entries in CMS_AttachmentHistory, the column AttachmentGUID have same values but different AttachmentName

Edit:

I think I need to check AttachmentHistoryGUID but this is not available as a property.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 24, 2021 05:40

Well, it looks like you are using also Workflows, so some entries for the non-published pages are still in the history table. Please, see this documentation to learn what tables are involved. Then, it also looks like you are using multi-lingual pages. So, one attachment could be translated into more languages. Or, there is some inconsistency in the DB too and you have orphaned records. But I cannot tell this for sure and you should probably contact the web developers who designed the site for you as they may know more about the project.
Also, isn't it possible that some pages (their respective page types) are using media selectors and work with media files and not with page attachments?

0 votesVote for this answer Mark as a Correct answer

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