Forums

Upload file not working when form called from CC

micalb 30 Apr, 2012
Hello, I have a FORM1 form (CFV4) that save some data in a DB and upload a file and it is working fine, I than have a CC (V4) that list the records of FORM1 and also this one is working fine.
Now, if I edit one record via link in CC I have all DB updated after FORM1 submit BUT if i upload a new file from the form nothing happen, also if i place debug in onfail upload there's no debug info, it seems that upload action is completely skipped while FORM1 is called from CC.
Is there any parameter to set in CC to have my file upload normally ?

Thank you for your help.

Michele
Max_admin 30 Apr, 2012
Hi Michele,

The save(create/update) event in CC will run the "on submit" even of your form, then it will store the data itself, however, it will not report any form errors and it will not care if your file was uploaded or wasn't (in case of size limits..etc).

So, basically, if your file meets the file upload conditions then it should be uploaded.

However, in order to get feedback from your the form event, you will have to use the "Task control" feature, drag a new form action to the end of your "on submit" event, the action should be of type "ChronoConnectivity Task", then drag another action of type "ChronoConnectivity Return to App", get both actions IDs (the red number), and use it in the task control area of your CC [Save/Update Data Task Control]:

Save Action Order: your ChronoConnectivity Task ACTION ID HERE.
Save Event: submit
Return After Save Action Order: your ChronoConnectivity Return to App ACTION ID HERE.

I hope you will be able to do it correctly, there is no tutorials yet so it may be tricky but I have tried to explain it carefully🙂

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
micalb 30 Apr, 2012
Thank you Max,

I'll try your solution asap and will report here, btw, I'm pretty sure the file upload is not rejected by dimesion and/or extension, the very same file upload work if I call the form not from CC.

Michele
Max_admin 01 May, 2012
Hi Michele,

Thank you, yes, I found this bug yesterday after your message, I have fixed that in the new version and you wouldn't need to implement the task control to get proper submit event processing.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
micalb 11 May, 2012
Thank you Max, is there any ETA to the new version?
I maybe found another problem , see my last post about delete with no ModelID

Michele
micalb 01 Jul, 2012
Hi Max,

Again a little problem in file upload in a form called by CC.
The file get uploaded correctly but in my form I have to save file name in a DB, the form is called with a model ID, eg 'allegato', so all fileds in a form will look like allegato[nome],allegato[cognome]....and finally allegato[file] where 'file' is the file name.
The file name is correctly populated in the the 'show html' but when I tried to change the filename via file button selector the problem start, if I put allegato[file] in the name and the same in upload action the file won't be uploaded.
If I put 'file' without model id file get uploaded but not saved in the DB, my workaround is to add a custom code, check if 'file' variable is not empty and push the value into $form->data[allegato][file].

My assumption is that CC should able to manage all this by his own, am I correct ?

Michele
Max_admin 05 Jul, 2012
Hi Michele,

Unfortunately the file upload field is different, it can't handle the Model ID, you will have to use a custom code action to manage the field data.

The new CF version has an upload widget feature, this will help when doing files stuff with CC or when having more than 1 field upload field (e.g: array of files associated to a db record), I still didn't build the installer yet though, you will need the new CF installer to be able to use the new CC and this is why I couldn't send it to you yet.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.