Hello, I've experienced problems with file upload.
I made a quick debug and found this check at line 93 of the file_upload.php action:
I think that should be added an additional condition in this way:
please consider is_array($file_post['name']) otherwise a single file wouldn't be uploaded.
Could you please check and confirm?
I made a quick debug and found this check at line 93 of the file_upload.php action:
if(in_array($field_name, $array_fields) AND !empty($file_post['name'])){// AND ($file_post['name'] === array_values($file_post['name']))){
I think that should be added an additional condition in this way:
if(is_array($file_post['name']) AND in_array($field_name, $array_fields) AND !empty($file_post['name'])){// AND ($file_post['name'] === array_values($file_post['name']))){
please consider is_array($file_post['name']) otherwise a single file wouldn't be uploaded.
Could you please check and confirm?
Hi davide.taddei,
What exactly is the problem you hare having?
If you have the File Upload set to Multi then it needs to have an array name and so the data will be an array. If it is not set to Multi then you don't need to use an array name and this code is not needed.
I guess that there might be a problem if you use an array name with Multi set to No . . . in which case the simple answer is to change the name.
Bob
What exactly is the problem you hare having?
If you have the File Upload set to Multi then it needs to have an array name and so the data will be an array. If it is not set to Multi then you don't need to use an array name and this code is not needed.
I guess that there might be a problem if you use an array name with Multi set to No . . . in which case the simple answer is to change the name.
Bob
Hello Bob, the problem I'm having is that with "Multi" set to NO the following loop at line 94 is skipped:
so the file isn't uploaded. Adding the condition written above the condition is false and it is executed the code at line 104 instead.
One more thing, the setting "Multiple" is not in File Upload action but in file_upload field, can you confirm it?
Thank you in advance
foreach($file_post['name'] as $k => $v){
so the file isn't uploaded. Adding the condition written above the condition is false and it is executed the code at line 104 instead.
One more thing, the setting "Multiple" is not in File Upload action but in file_upload field, can you confirm it?
Thank you in advance
Hi davide.taddei,
In my experience the Files upload works correctly for both single and multiple uploads.
It is correct that with Multi as No there is no array to scan so the code is skipped.
The Multiple setting is in the File Upload element and there is a corresponding Array Fields box in the Upload Files action.
Bob
In my experience the Files upload works correctly for both single and multiple uploads.
It is correct that with Multi as No there is no array to scan so the code is skipped.
The Multiple setting is in the File Upload element and there is a corresponding Array Fields box in the Upload Files action.
Bob
Hi Bob, I attach a screenshot with the Multiple setting in the field, I haven't found a corresponding field in the File Upload actions but I confirm I see the array field (please check the second screenshot).. that's weird..
Could you please check?
Could you please check?
Hi davide.taddei,
What am I checking?
I can't see the Name of the File Field element but I guess that it is collaboraconnoicv or collaboraconnoi-cv or collaboraconnoicv[]
I'm guessing the first - in which case it is not an array and the Array fields box of the Files Upload action should be empty,
Bob
What am I checking?
I can't see the Name of the File Field element but I guess that it is collaboraconnoicv or collaboraconnoi-cv or collaboraconnoicv[]
I'm guessing the first - in which case it is not an array and the Array fields box of the Files Upload action should be empty,
Bob
This topic is locked and no more replies can be posted.