ERPNext Conference 2019* ERPNext.com Blog

How to add a private files in Employee doctype


#1

hi
in employee doctype i want to add a private files like national id and passport images
i added anew section break with PERm level and under this section i added attached field
but when i add attachment employee can see the files under ATTACHMENTS in the left
how can i upload this files into the doctype and prevent user to see them


#2

i get around this problem but i think this to child table and upload what i want in this table
but i think this is not Professional


#3

If you want to control Attachments with permissions levels, create Fields with fieldtype as Attach.


#4

thank you for your replay
i did this but the problem is after i upload the file the user can see all attachment files in ATTACHMENTS
in the left panel under ASSIGNED TO


#5

Dont upload files using the left sidebar. Attach it in the form itself.


#6

A question in the form of a statement: Files on the left sidebar are stored in /public... and files with the attach as shown are stored in the db?


#7

i attach in the form itself and it also shown in sidebar


#8

Do the side attachments show if you log in as a user with restricted permission?


#9

yes
it’s shown


#10

Ok my bad. I think we don’t have any permissions for Files attached in a doctype.

@fatheyabdelslam Will you open a feature request at https://github.com/frappe/frappe/issues


#11

Sure


#12

Is there any workaround for this? I have the same issue. I want to hide attachments in Employee Doctype from all but it’s in the public folder. Can anyone please help me.


#13

You can use child table


#14

Thanks youssef for the update. Can you please explain a bit on using child table. Any example would really put me in the right direction

Thanks


#15

It is a kind of circumvention of the problem that is not a professional solution to it.
You can check these links for child table

https://erpnext.com/docs/user/manual/en/customize-erpnext/articles/child-table-