How can we access a file?

2
Hi, I have a scenario where users while filling the form, need to download a "policy” document which should be signed by them. So, I tried using button as a link to open the policy document in the following way.   But, seems like the URL is only accessible within the client's domain and can't be accessed from outside. So, they have shared a document. Can someone please help me in achieving this situation.
asked
2 answers
3

Hey there,

I will work out the scenario where you have a document available within your application (so no external reference)

 

  1. Add a configuration entity (1) with a file document generalization
  2. Add a admin page with upload functionality so an admin can upload the file to the system
  3. Add a download button for the end user with a microflow
    1. Within this microflow retrieve the entity (1) from the database and use the “download file” action to download the file for the user
    2. Check the following link for more information: https://docs.mendix.com/refguide/download-file/

 

answered
0

Hi,

if your file is uploaded to your application (and the user has entity access), it is possibel to download it directly using the file id.

<applicationurl>/file?fileID=<fileID>

 

if you want to make this dynamic with several changing files, eg. as part of an email, you can get the applicationurl as string from a java action from the community commons module. the fileID is an attribute of your file entity.

 

answered