Hi There, I have searched the forums and found a lot of helpful information in setting this up - and so far I have the following that is working great:
A form with 3 File upload fields that successfully upload the files to a custom folder and it also stores the filenames (e.g. 20140528100148__DSC0194.jpg) in SQL.
But I can't figure out how to append the path name (e.g. http://www.sample.com/images/uploads/) to the file name so that when i run the Excel export and download the .xls file that it has a nice link in the spreadsheet columns that you can click on. E.g:
http://www.sample.com/images/uploads/20140528100148__DSC0194.jpg
At the moment, it just has the filename only in the spreadsheet. E.g. "20140528100148__DSC0194.jpg".
Thanks!
Hi shifty,
you can do that by adding a Custom Code action between the Upload Files action and the DB Save action to edit the file name to include the link. Or, better, as the link is already in the $form->data array then copy that value over the file_name.
Bob
Thanks GreyHead - I will give it a go... Not sure if you can update the FAQs section - but you probably know who can... This page in the FAQs:
http://www.chronoengine.com/faqs/63-cfv4/cfv4-working-with-form-data/2697-how-can-i-use-the-form-data.html
It needs the link to the FAQ "How can I use the form data with PHP" updated. The correct URL to that FAQ is:
http://www.chronoengine.com/faqs/63-cfv4/cfv4-working-with-form-data/2594-how-can-i-use-the-form-data-with-php.html
Hi _shifty,
Thanks for pointing out the broken link - it's fixed now.
Bob
Assuming the database field name which is going to include the file path is named "path" then you can use this code:
<?php
$form->data["path"] = $form->files["file_field_name"]["path"]; // replace the file_field_name
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thank you sir for this reply. but, after puting it this way <?php
$form->data["upload_photo"] = $form->files["file_field_name"]["upload_photo"]; // replace the file_field_name but after that, the file path does not show on the upload_photo field. i did every thing you said.
The code is added into a "custom code" action which is AFTER the "upload files" ?
And the "DB Save" is AFTER both ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Yes Sir the DB is after both
Ok, after the "custom code" and before the "db save" please add a debugger action and post the output!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thanks alot. it worked. but it is not click able. on the show data and on excel sheet <a href='http://reg.christembassyughelli.org/components/com_chronoforms/uploads/ICLC_REG_SPECIAL/20140807183521_432039_385404221487369_216581293_n.jpg'>20140807183521_432039_385404221487369_216581293_n.jpg</a>
Also, i want to know how to submit a form to different tables base on a field criteria. that is, Mr A,B,C and D are members of my website. and i want report from them each day. i want their reports to be submitted on different tables that i created for them. so, their user name will be the criteria.. thanks alot i appreciate your quick response
Hi marverance,
I don't think that you can dynamically set a table name in any of the ChronoForms actions so you'd need to use a Custom Code action and write your own mySQL query to do that.
But. . . why are you using separate tables? It's better design to use one table and add a membername or, better, user_id column to it.
Bob
the report from user A, B, C, D will be submited to four head of departments. report from user A will be submitted to department 1. User B report to department 2. Report from user C will be submited to department 3. and so on. if i use the same table, all the HOD will see each others reports. please if it is a code i will have to use, please help me with the template code. thanks alot.😀
In this case you may build a form and use the "Export CSV" action, drag a "DB Multi record loader" before it to load the data you need for a specific HOD, you can control this using some data parameter, and that would generate a report with records for that HOD only, each record in the table must have a HOD identifier though, like a new field named "hod" with fields like a, b, c or d
Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thanks sir. but i need each of the HOD to login to the site, and see the forms that were submitted for him. and will not be able to see the forms submitted for the other HODs
This is also possible if you have a field in the table to associate the records to different HODs
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.