Closed gchauhan83 closed 1 year ago
Hello Ganesh,
This is not currently possible within the module, and is not something within the scope of future developments. Unfortunately, we also don't know the process for converting a REDCap given file upload ID into a url, If there's a module that is able to do this already, I suggest contact their developers for more insight.
The module is capable of having image upload/download into its own folder, though. You'd have to upload your photo twice, but you'd be able to embed your image easily.
Hi,
Thank you for your quick response. In RedCap it is possible to get the URL of an uploaded file using the SQL query. Please one of the responses on the RedCap community page: [https://community.projectredcap.org/questions/49874/is-there-anyway-to-pipe-file-name-of-the-file-uplo.html]. The URL is generated in an Descriptive Filed in RedCap. I tried and it worked. But I am not sure how to pipe this URL generated in the Descriptive Field in to the HTML. The moment you put a special redcap variable within the double quotes of the img src tag, the whole syntax changes and is not executed. Please see below for the syntax.
Thanks for any suggestions.
Best Ganesh
Hello Ganesh, the link you've given doesn't open up to any syntax, though this appears in the url:
{$redcap['url_file']}&id={$redcap['approval_drc']}
I assume that's what you're inputting into the src attribute? So it would look something like:
< img src="{$redcap['url_file']}&id={$redcap['approval_drc'] }" >
The syntax changes after your input are likely a result of the editor converting special characters to their entity equivalent. This is the default behaviour of the editor, and something you'd have to change locally in the initializeEditor function of CustomTemplateEngine.php. Please see the entities setting at https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html.
Hi, Custom Template Engine is a great resource. Thank you for this. Was wondering if it was possible to embed an image file that is attached to a form through the file upload field. If so, how are we going to define the same in the HTML format, what should be the variable name.
Currently RedCap gives only the "id" associated with field. Is it possible to convert this "id" into an URL so that it can be automatically embedded. Another External Module of RedCap called "File Upload Embed" is some how able to create an URL from the same to embed files for a view in RedCap.
Thanks for your response.
Best Ganesh