BCCHR-IT / custom-template-engine

REDCap module that allows you to create HTML templates and fill them with record data from your project. You can download the filled templates as a PDF, which are saved to the File Repository.
MIT License
10 stars 7 forks source link

accessibility settings for the images folder? #10

Closed wibeasley closed 4 years ago

wibeasley commented 4 years ago

The current documentation recommends "Required configuration that defines the publically accessible storage of images uploaded by users."

Running IIS, we see the folder C:/inetpub/wwwroot/redcap/{current version}/ExternalModules/images.

I don't want to expose something that shouldn't be. Can you tell us what exactly needs to be set & how?

And thanks for developing this. We're excited to use it for images.

BCCHR-IT commented 4 years ago

Hello,

Thanks for showing interest in our module!

You must determine an images folder that must be publicly accessible, and can be seen by everyone. For your setup I believe it would be any directory path under wwwroot/ that doesn't include your REDCap version folder. This is because after an upgrade, you'd be unable to access your images. You would set this when you first install the module, and configure the settings. If the folder doesn't exist, then the module will create it for you. When you do this, please remember to use a relative path.

wibeasley commented 4 years ago

@BCCHR-IT, thanks for the advise --that helped a lot. Somehow when we're uploading the file newplot3_1574.png, the wizard creates the path becomes ../../images/ewplot3_1574.png. In other words the /n or n gets deleted. (I'm wondering if something is converting the forward slash to a backslash within IIS, then the \n is interpreted as a newline character?)

The quick solution is to click the 'source' button in the template designer, and fix the path by hand (i.e., change it to ../../images/newplot3_1574.png)

I believe it would be any directory path under wwwroot/ that doesn't include your REDCap version folder.

BTW, we believe that our new folder has to be within C:/inetpub/wwwroot/redcap/. When we tried to go up an additional directory, the external module threw an error.