Problem Implementing File Uploading

Hello,

I am attempting to create a simple DaDaBik application that allows the uploading of .mf4 and .txt files to the web server.
These files will be a maximum of 30MB each in size.
I start with a very basic log_files table containing an ID, filename, date-timestamp, extension, source_id, and user field. Most of these will be auto-populated from the file selection and at the time of record insertion. The filename and source_id are the only things the user should have control over which can be easily accomplished via the form configurator. I am using the generic_file field type for the filename field in the log_files table.

Once the upload is working I then intend to write a backend script that moves the files from the upload folder defined in the application to another folder on our network where these files will be further processed and removes the record from the log_files table. So, the table should only contain records of files still being processed that were newly imported.

The current problem is that I cannot seem to get the upload portion to work correctly. Maybe I am misunderstanding something in the documentation regarding this upload feature. Using different size test files does not seem to make a difference or I can discern no pattern if it does.

I currently get either the error 'Unexpected error, the data has not been correctly POSTed.' or 'An error occurred when uploading a file.'. This occurs every time.

I have put the following variables in my config_custom.php file:
[pre]
//Upload settings
$enable_uploads = 1;
$upload_directory = '/srv/www/htdocs/mynewapp/uploads/';
$allowed_file_exts_ar[0] = 'txt';
$allowed_file_exts_ar[1] = 'TXT';
$allowed_file_exts_ar[2] = 'mf4';
$allowed_file_exts_ar[3] = 'MF4';

// max allowed size for the uploaded files (in bytes)
$max_upload_file_size = 30000000;


[/pre]

I have also edited the .htaccess in the upload folder to contain 'Allow from All' and verified the proper write permissions.

Support Details:
[pre]
You are runnning the last 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.2.5

mysql version: 5.5.5-10.2.31-MariaDB

Web server: Apache

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36

[/pre]


Any troubleshooting assistance is appreciated.

Thanks,

-Todd
 

eugenio

Administrator
Staff member
Hello,
the "Unexpected error, the data has not been correctly POSTed" is a very specific error that arises when DaDaBIK can guess that not all the data available in the form has been correctly posted.
This typically occurs when your PHP value for

post_max_size and/or upload_max_filesize are not enough for your use case.

You said, however, that it happens even with small files?


An error occurred when uploading a file, instead, is a generic error that arises when PHP cannot complete the upload process, typically the reason is a permission issue, can Apache write in /srv/www/htdocs/mynewapp/uploads/ ?

Is there any reason why you don't directly write in the final folder destination?

BEst,
 
Top