Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Direct link to an uploaded file

  • squidy
  • squidy's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 4 months ago #231693 by squidy
Direct link to an uploaded file was created by squidy
Please help us help you and fill in where relevant:
Your version of LimeSurvey:
5.3.32+220817
Own server or LimeSurvey hosting: Own
Research theme/template: Fruity
======================
Hey..
I'm trying to link a user-uploaded file in a 3rd party report. However, I am getting a Forbidden message. I know direct access is a security issue, but I need to enable this access from a specific server and I will configure security in apache.

I tried this:
​​​​​
Code:
<img src="/upload/surveys/{SID}/files/{stristr(str_replace('filename\":\"', '', stristr(IDFOTO3X4, 'filename\":\ " ')), '\"', 'true')}">

It's possible?

Using LS 5.x

Please Log in to join the conversation.

  • squidy
  • squidy's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 4 months ago #231707 by squidy
Replied by squidy on topic Direct link to an uploaded file
I solved it creating a symbolic link to files folder.. Something like this:

ln -s ..limesurvey/upload/surveys/XXXXXX/files/ ..limesurvey/upload/custom

Then make a link like this:
<img src="/upload/custom/{stristr(str_replace('filename\":\"', '', stristr(QUESTION, 'filename\":\ " ')), '\"', 'true')}">

Using LS 5.x

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose