Attach an Excel file to Attach field

I have generated an Excel file using openpyxl by clicking a button.
I am able to generate the file in /private/files and attach it to the Attach field.
But when I click on the field to download the file, I get 403 Forbidden You don’t have permission to access this file error.
File permissions are the same as the files uploaded from the UI. I am skipping any step?

@RWEMA_Aimable
You can download excel file excel using javascript too.

How can i read attached excel file in client side ?

@RWEMA_Aimable Did you found any solution regarding this?

as i understand you are attached file from privet
if you set as public and try

setting a file public will be accessible by one without login, and a matter of security concern.