I'm running into a problem using Channel Forms on EE 3.4.4 with a file field inside a grid. If the filename contains a comma it will initially submit but subsequent saves return an error message: 'There was a problem with one or more grid fields'.

Everything works as intended through the Control Panel, it only appears to be affecting Channel Forms. As soon a I remove the file with the comma in the name it works perfectly fine.

Has anyone had any similar problems with this at all?

1 Answer 1


Caution: I've noticed that duplicate files are being added when submitting an entry. I'm not sure whether this is a result of the below or not. First test indicate not but I'd use the below with caution.

I have managed to fixed this problem but its not entirely elegant.

Wherever the file name is being referenced in the 'file field' view file I've added str_replace to convert %2C to a comma. <?=str_replace('%2C', ',', $string)?>


<div class="file_field">
    <div class="file_set <?=$set_class?>">

        <p class="filename">
            <img src="<?=$thumb?>" alt="<?=str_replace('%2C', ',', $alt)?>"/> <!-- Optional -->
            <br />
            <?=str_replace('%2C', ',', $filename)?> <!-- Optional -->
        <p><?=str_replace('%2C', ',', $hidden);?></p> <!-- Required -->

    <div class='file_upload'>
        <p class="sub_filename">
            <?=$filebrowser ? $upload_link : ''?>

        <div class="no_file <?=($filebrowser || $filename) ? 'js_hide' : ''?>">
            <p class='sub_filename'><?=$upload?></p>
            <?php if ( ! $allowed_file_dirs):?>
            <?php else: ?>
            <?php endif; ?>

            <?php if ( ! empty($existing_files)) : ?>
                <p class="file_existing"><?=$existing_files?></p>
            <?php endif; ?>
<div class="clear"></div>

I'm not marking this answer as accepted as there is probably a better way to solve this, however, I thought I'd add the answer in case someone else has the issue and needs a temporary fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.