Hi, guys.
Here is my issue.
I've created a form in CFv5 and DB table 'mv2_publications' for it to store information about publications, its authors and conferences IDs those publications are related to. As for the conferences there was created a proper table "mv2_conferences".
Then i've created a connection with main model "Publication" in CCv5 due to this faq (http://chronoengine.com/faqs/72-ccv5/5208-connectivity-edit-with-chronoforms.html) in order my form would be opened through a connection view list to edit all necessary data.
So, here is my form fields with its names:
textbox - Publication[publication_title];
textbox - Publication[author_1] ... and 5 more fields like this one Publication[author_ 2] and so on;
dropdown - Publication[conf_id] - this field takes its names and values from DBRead action Model (as a result i have a dropdown list of conferences i wish to link my publication record to. The conferences data are stored in a DB table "mv2_conferences");
and, of course, i haven't forgot about
a hidden field - Publication[publ_id] - to store ID of currently edited publication record.
In my DB table "mv2_publications" i have all necessary fields:
publ_id
publication_title
author_1, ... , author_6
conf_id
My actions panel:
onLoad{
DBRead - for making Model for the dropdown- Publication[conf_id]
HTML(RenderForm)
}
onSubmit{
ConnectionAction
}
In described case with this set of actions and form elements all works perfect: the form is opened through through a connection view list of publications when i want to edit an existing record or save a new one into the DB.
The next step i wish to take is adding a file upload ability to my form. I want to upload publications files to the server and save their names in "mv2_publications" DB.
First, for this purpose i've added one more field to my DB and named it "fil".
Then i've inserted "Files Upload" action into onSubmit block just before ConnectionAction. Then i have changed its Files Config field value to Publication[fil]:doc.
I've added a new File Field element to my form an named it "Publication[fil]".
I've tested my form entered through the connection list view. As a result all entered was saved in DB except filename. Moreover the file was not uploaded to the server.
OK, i've changed Publication[fil] field name both in File Field and in Files Upload action simply to "fil". As a result the file was uploaded to the server (i found it in chronoforms default 'uploads' folder), but its name wasn't saved in database.
And that is my problem. I've read all the faqs and forum topics about the similar issue, but there were no topics about file upload with CFv5+CCv5 joint use and it seems to me i'm deadlocked.
Please, help me if you can. I would really appreciate.
Here is my issue.
I've created a form in CFv5 and DB table 'mv2_publications' for it to store information about publications, its authors and conferences IDs those publications are related to. As for the conferences there was created a proper table "mv2_conferences".
Then i've created a connection with main model "Publication" in CCv5 due to this faq (http://chronoengine.com/faqs/72-ccv5/5208-connectivity-edit-with-chronoforms.html) in order my form would be opened through a connection view list to edit all necessary data.
So, here is my form fields with its names:
textbox - Publication[publication_title];
textbox - Publication[author_1] ... and 5 more fields like this one Publication[author_ 2] and so on;
dropdown - Publication[conf_id] - this field takes its names and values from DBRead action Model (as a result i have a dropdown list of conferences i wish to link my publication record to. The conferences data are stored in a DB table "mv2_conferences");
and, of course, i haven't forgot about
a hidden field - Publication[publ_id] - to store ID of currently edited publication record.
In my DB table "mv2_publications" i have all necessary fields:
publ_id
publication_title
author_1, ... , author_6
conf_id
My actions panel:
onLoad{
DBRead - for making Model for the dropdown- Publication[conf_id]
HTML(RenderForm)
}
onSubmit{
ConnectionAction
}
In described case with this set of actions and form elements all works perfect: the form is opened through through a connection view list of publications when i want to edit an existing record or save a new one into the DB.
The next step i wish to take is adding a file upload ability to my form. I want to upload publications files to the server and save their names in "mv2_publications" DB.
First, for this purpose i've added one more field to my DB and named it "fil".
Then i've inserted "Files Upload" action into onSubmit block just before ConnectionAction. Then i have changed its Files Config field value to Publication[fil]:doc.
I've added a new File Field element to my form an named it "Publication[fil]".
I've tested my form entered through the connection list view. As a result all entered was saved in DB except filename. Moreover the file was not uploaded to the server.
OK, i've changed Publication[fil] field name both in File Field and in Files Upload action simply to "fil". As a result the file was uploaded to the server (i found it in chronoforms default 'uploads' folder), but its name wasn't saved in database.
And that is my problem. I've read all the faqs and forum topics about the similar issue, but there were no topics about file upload with CFv5+CCv5 joint use and it seems to me i'm deadlocked.
Please, help me if you can. I would really appreciate.