Forums

Edit Image with from CC (with MODEL_ID)

BigStef 13 Mar, 2013
Hi,
I have followed your topic about editing an image in CF. Works great from my CC main table.
Now I have another CC with one to many joined table. So here I have to modify my form, adding the name of my MODEL_ID before each name of field as it is recommended. This works great for normals fields like i.e. 'Name' wich is now 'ModelId[name]'...
Strangely it is absolutely impossible to make it work for my image upload. I can display the image in my form (don't forget : it is an editing form :-)), I can erase this image, but I can't upload another one.

That's the code in my form, the div concerned by the upload :
<div class="ccms_form_element cfdiv_file" id="eleve_portrait1_container_div" style="">
<label>Nouveau portrait</label>
<input type="hidden" name="AccueilMembre[eleve_portrait]" value="{eleve_portrait}" alt="ghost" />
<input class="" title="" type="file" name="AccueilMembre[eleve_portrait]" />
<div class="clear">
</div>
<div id="error-message-eleve_portrait">
</div>
</div>

In the value for the "ghost", I tried some combination ('AccueilMembre' is my MODEL_ID and 'eleve_portrait' the field name) :
[list]AccueilMembre[eleve_portrait]
{eleve_portrait}
{AccueilMembre.eleve_portrait}[/list]

That's the param in my event 'Upload Files' On Submit :
Fields Configuration : AccueilMembre[eleve_portrait]:jpg-jpeg-gif-png
Max Size in KB : 300

And that's all, i put no other params in that event...

When i check, nothing is registred in the Table, and there's no files uploaded in the folder...

Any suggestion to make this work ?
GreyHead 13 Mar, 2013
Hi BigStef,

If you leave the value empty does ChronoForms add the value from the database? I would expect it to.

Otherwise the <?php echo . . . ?> version should work OK.

Bob
BigStef 22 Mar, 2013
Hi Bob,
and thanks for your answer... I take some time to come back here because, as i can't find how to make this work (have tried most of possible combination), so i took a few days to instal my site on a test URL, so maybe if you have few minutes one day you can have a look ? Here's the URL :
Test It
I have Debbug on...
Try to edit a existing picture, u can erase it... Try to upload a picture, nothing...

I don't know if you do that kind of things, but if you need to log in backend, username and password are in the URL.
This topic is locked and no more replies can be posted.