Error uploading a file

deep64blue

DaDaBIK Guru
I'm trying to allow a user to upload a small picture of themselves but getting a generic error "An error occurred when uploading a file."

$upload_directory = '/home/xxx/WebRoot/uploads/'; <-this is correct
$max_upload_file_size = 20000000; <- file is smaller than this
$allowed_file_exts_ar[4] = 'png'; < image is png
$allowed_file_exts_mime_ar[4] = 'image/png'; < image is png

Field is set as an image_file in the Forms configurator.

Webserver has write permissions to the PHP temp upload folder and my dadabik one.

No errors getting reported in Apache or PHP logs.

Anything else I should be checking?

System details said:
Your current DaDaBIK version
You are using DaDaBIK version 11.2-Elba enterprise, installed on Dec 14, 2021 (installation code: 17299615d85299380a), the latest version of DaDaBIK is 11.2-Elba released on Nov 16, 2021

You are runnning the latest release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enteprise to Platinum) please contact us.

System info
PHP Version: 7.4.25

mysql version: 5.5.5-10.4.21-MariaDB

Web server: Apache/2.4.51 (Unix) OpenSSL/1.1.1l PHP/7.4.25 mod_perl/2.0.11 Perl/v5.32.1

Client: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

URL installation: http://localhost/Web/sblpa/all/
 

deep64blue

DaDaBIK Guru
Yes it does.

Further testing reveals it works for an admin user but not any other group - I'm assuming that means it's a permissions issue.
 

eugenio

Administrator
Staff member
I assume that the other groups have insert/edit permissions on that field, otherwise they wouldn't even see the field for uploading, right?
If this is the case, it's a strange behaviour that I can't explain without looking into the actual application.
If you want you can open a support ticket and we can have a closer look to the problem.

Best,
 

deep64blue

DaDaBIK Guru
I'm trying to allow a user to upload a small picture of themselves but getting a generic error "An error occurred when uploading a file."

$upload_directory = '/home/xxx/WebRoot/uploads/'; <-this is correct
$max_upload_file_size = 20000000; <- file is smaller than this
$allowed_file_exts_ar[4] = 'png'; < image is png
$allowed_file_exts_mime_ar[4] = 'image/png'; < image is png

Field is set as an image_file in the Forms configurator.
I came back to this project and have figured out the problem @eugenio - when a field is set to be a file (image_file or generic_file) in the forms configurator and the edit permissions is set to "My" then you will encounter a permissions issue. Text fields etc can be edited fine when set to "My" only files seem to be affected.

It's not a major issue for this application as the user can only see their own records with "read" set to "My" so I've just set edit to "yes" which works fine.
 
Top