Hello to all!
I have a nicely set up Table with the uploaded filename view. I wanted to create file download link to download each listed file but did not suceed.
Steps I have done so far:
1. Create file download function download_photo:
a) with the direct link to folder on server where the file is located, e.g. /var/www/vhosts/domain.com/images/uploads/FOTO/ in
File or directory path field instead of built-in {path:root};
b) leave all other fields as default;
2. Create photo_download_link wiew Link with Content {var:submissions_list.row.Submission.spFoto} where submissions_list is Read Data function and Submission.spFoto is Model.Field; URL and/or URL parameters aid={var:submissions_list.row.Submission.aid}; Event photo_download
3. Create Event photo_download with the function call: {fn:download_photo} ;
4. And finally, add the view to the Table - Columns views - Submission.spFoto: {view:photo_download_link}
So - filename is visible in the Table, link has been created. By pressing that link, download function has being executed; only problem is that it downloads FOTO instead of file.
My suspicion is that I have to somehow include the filename in that path - tried {var:submissions_list.row.Submission.spFoto} and {data:Submission.spFoto} with no sucess.
Any suggestions?
BTW - if I choose Auto selection option "Last modified" - i get file download, but as expected - only the last modified file, not the file for each Submission in the list.
Any sugestions?
Elita
I have a nicely set up Table with the uploaded filename view. I wanted to create file download link to download each listed file but did not suceed.
Steps I have done so far:
1. Create file download function download_photo:
a) with the direct link to folder on server where the file is located, e.g. /var/www/vhosts/domain.com/images/uploads/FOTO/ in
File or directory path field instead of built-in {path:root};
b) leave all other fields as default;
2. Create photo_download_link wiew Link with Content {var:submissions_list.row.Submission.spFoto} where submissions_list is Read Data function and Submission.spFoto is Model.Field; URL and/or URL parameters aid={var:submissions_list.row.Submission.aid}; Event photo_download
3. Create Event photo_download with the function call: {fn:download_photo} ;
4. And finally, add the view to the Table - Columns views - Submission.spFoto: {view:photo_download_link}
So - filename is visible in the Table, link has been created. By pressing that link, download function has being executed; only problem is that it downloads FOTO instead of file.
My suspicion is that I have to somehow include the filename in that path - tried {var:submissions_list.row.Submission.spFoto} and {data:Submission.spFoto} with no sucess.
Any suggestions?
BTW - if I choose Auto selection option "Last modified" - i get file download, but as expected - only the last modified file, not the file for each Submission in the list.
Any sugestions?
Elita
The same problem is when I create Photo view with php function:
I have created php function for the photo view with the view Event (thanks to earlier Forum posts) :
$path='/var/www/vhosts/domain.com/images/uploads2018/FOTO';
$file= $row['Submission']['spFoto'];
echo "<img src='{$path}{$file}' />";
when opening the Submission with the view event I got broken image link thumbnail - it points to folder, not the file:
<img src="/var/www/vhosts/domain.com/images/uploads2018/FOTO">
what would be the solution here? Thank you in advance.
Elita
I have created php function for the photo view with the view Event (thanks to earlier Forum posts) :
$path='/var/www/vhosts/domain.com/images/uploads2018/FOTO';
$file= $row['Submission']['spFoto'];
echo "<img src='{$path}{$file}' />";
when opening the Submission with the view event I got broken image link thumbnail - it points to folder, not the file:
<img src="/var/www/vhosts/domain.com/images/uploads2018/FOTO">
what would be the solution here? Thank you in advance.
Elita
Hi Elita,
To view the file in the browser you need to use the web url, but you are using the absolute server url, example:
Best regards,
Max
To view the file in the browser you need to use the web url, but you are using the absolute server url, example:
http://www.domain.com/images/uploads2018/FOTO/
Best regards,
Max
Of corse!😀 Tahnk you, Max. However, I still cannot get the filename in that path - most certainly the code for retrieving that is wrong.
Could you correct that?
Could you correct that?
$path='http://www.mydomain.com/images/uploads2018/FOTO/';where Submission is Model and spFoto is the DB field where filename is recorded.
$file= $row['Submission']['spFoto'];
echo "<img src='{$path}{$file}' />";
Hi Elita,
The Download function requires the server path, which is the one you are using before.
For the code, where do you call this code ? if its in a PHP function then is the $row var defined ? I think that you can just use an HTML view instead:
The Download function requires the server path, which is the one you are using before.
For the code, where do you call this code ? if its in a PHP function then is the $row var defined ? I think that you can just use an HTML view instead:
<img src="http://www.mydomain.com/images/uploads2018/FOTO/{var:table_name.row.Model.field_name}" />Best regards
Max, for the file download i wrote before in my first message:
I have a nicely set up Table with the uploaded filename view. I wanted to create file download link to download each listed file but did not suceed.
Steps I have done so far:
1. Create file download function download_photo:
a) with the direct link to folder on server where the file is located, e.g. /var/www/vhosts/domain.com/images/uploads/FOTO/ in File or directory path field instead of built-in {path:root};
b) leave all other fields as default;
2. Create photo_download_link wiew Link with Content {var:submissions_list.row.Submission.spFoto} where submissions_list is Read Datafunction and Submission.spFoto is Model.Field; URL and/or URL parameters aid={var:submissions_list.row.Submission.aid}; Eventphoto_download
3. Create Event photo_download with the function call: {fn:download_photo} ;
4. And finally, add the view to the Table - Columns views - Submission.spFoto: {view:photo_download_link}
So - filename is visible in the Table, link has been created. By pressing that link, download function has being executed; only problem is that it downloads FOTO instead of file.
My suspicion is that I have to somehow include the filename in that path - tried {var:submissions_list.row.Submission.spFoto} and {data:Submission.spFoto} with no sucess.
Any suggestions?
BTW - if I choose Auto selection option "Last modified" - i get file download, but as expected - only the last modified file, not the file for each Submission in the list.
I have a nicely set up Table with the uploaded filename view. I wanted to create file download link to download each listed file but did not suceed.
Steps I have done so far:
1. Create file download function download_photo:
a) with the direct link to folder on server where the file is located, e.g. /var/www/vhosts/domain.com/images/uploads/FOTO/ in File or directory path field instead of built-in {path:root};
b) leave all other fields as default;
2. Create photo_download_link wiew Link with Content {var:submissions_list.row.Submission.spFoto} where submissions_list is Read Datafunction and Submission.spFoto is Model.Field; URL and/or URL parameters aid={var:submissions_list.row.Submission.aid}; Eventphoto_download
3. Create Event photo_download with the function call: {fn:download_photo} ;
4. And finally, add the view to the Table - Columns views - Submission.spFoto: {view:photo_download_link}
So - filename is visible in the Table, link has been created. By pressing that link, download function has being executed; only problem is that it downloads FOTO instead of file.
My suspicion is that I have to somehow include the filename in that path - tried {var:submissions_list.row.Submission.spFoto} and {data:Submission.spFoto} with no sucess.
Any suggestions?
BTW - if I choose Auto selection option "Last modified" - i get file download, but as expected - only the last modified file, not the file for each Submission in the list.
This topic is locked and no more replies can be posted.