Buy Now
Sign in

file does not upload

Ślusarczyk , July 20 2016
Ś
Ślusarczyk
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
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Ś
Ślusarczyk
Thanks! It works now.

Removing the Array field entry did the job.
Z
zaplcgn
yeah i did it and it works now, great