Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Custom Document Attachments and Images View modes: 
User avatar
Guest
Ventrasoft - 11/8/2012 8:53:38 PM
   
Custom Document Attachments and Images
I have a reference library section in the website. It is built by custom documents. Each library (i.e. Birds, Bears, etc.) has their own custom document. Right now I am at roughly 64,000 documents spread across 200 different custom documents. Everything is going great and now I have a new requirement.

I need to be able to allow regular authenticated site users (not editors) the ability to upload a photo or document. I need it attached to the document so it is in the documents life cycle (i.e. When document gets deleted so do all attachments). Here are the requirements.
1) Authenticated user can upload photo or document.
2) photo/document is stored with the custom document and within the document life cycle.
3) Users cannot modify or delete documents already uploaded. (Their own or others).
4) Display documents and photos/images to everyone.

I have mocked up using the contribution web part and that didn't meet all three criteria. I also attempted to use the file with direct uploader and that didn't work since it is 1 to 1. Then I tried the document attachments attribute type with a form control of Document attachments control, then using an alternative form just for that field. It came the closest, but the grid displayed allows editing of all attachments.

Perhaps I am over thinking it, but I just need a straightforward way for an end user authenticated, to simply be able to upload a document attachment, that I can resize to my specs during upload as well as limit the file type extensions. Once uploaded the users shouldn't be able to edit them again or delete them.

I was contemplating developing a custom control or web part, but I wanted to make sure that is the only way to go first.

Any thoughts would be very much appreciated.

User avatar
Member
Member
Ventrasoft - 11/9/2012 6:20:26 PM
   
RE:Custom Document Attachments and Images
does any have any ideas on this ?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 11/15/2012 5:11:12 AM
   
RE:Custom Document Attachments and Images
Hello,

we were communicating via e-mails so for other visitors:

I would advise using a structure of documents:

- category
-- image 1
-- image2

Then if you delete the "category" document, it automatically deletes all children. Administrators can also move the images, whilst attachments cannot be moved between documents.

In this case you can use the File uploader or User contribution (and set up properties so that users can upload a new document, not edit nor delete).

Files can be resized and restricted due to the extension. See the documentation:

http://devnet.kentico.com/docs/7_0/devguide/files_related_settings.htm
http://devnet.kentico.com/docs//7_0/devguide/resizing_images_on_upload.htm

If you need to use attachments, you would need to use a custom uploader which will create an attachment by API. You can find sample codes in Site manager -> Support -> API examples.

Best regards,
Helena Grulichova