file does not upload

Ślusarczyk 20 Jul, 2016
Hi,

I have some problems with uploading a file. I searched the forum I fixed some issues but still no success.
I have the "File Upload" action in "on submit" event.
Files config is set to: zdjecie:jpg-png-gif
Array fields is set to: zdjecie
(File Field Name is "zdjecie")
Chmod of upload folder is set to 755
HTML (Render Form) has AJAX Submit set to Yes
Form method is set to File

After I turned off AJAX Submit I got this:
Warning: Invalid argument supplied for foreach() in .../public_html/wp-content/plugins/chronoforms/admin/chronoforms/actions/file_upload/file_upload.php on line 94

I tried adding custom code
    <?php
    echo'<div>$_FILES: '.print_r($_FILES, true).'</div>';
    ?>


But I got this:
$_FILES: Array ( [zdjecie] => Array ( [name] => 1519562.jpg [type] => image/jpeg [tmp_name] => /tmp/phpK1ZDvu [error] => 0 [size] => 91220 ) )
Warning: Invalid argument supplied for foreach() in ../public_html/wp-content/plugins/chronoforms/admin/chronoforms/actions/file_upload/file_upload.php on line 94

Any ideas?
GreyHead 20 Jul, 2016
Hi Ślusarczyk,

AJAX submission doesn't support file uploads so that explains the first part.

Please remove the Array fields entry as it looks as though you aren't using an array name for your upload. I think that is probably the problem.

Bob
Ślusarczyk 20 Jul, 2016
Thanks! It works now.

Removing the Array field entry did the job.
zaplcgn 19 Feb, 2018
yeah i did it and it works now, great
This topic is locked and no more replies can be posted.