Import error.File was not uploaded successfully

Hello everyone

When i try to import data (like import contacts/accounts…)
I got an error “File was not uploaded successfully. It may be that the ‘upload_max_filesize’ setting in your php.ini file is set to a small number”
BUT my php.ini all upload setting is set correct.(50+MB post_max and upload_max_filesize )
Also i can upload file intro Document module (like test.txt file)

as one of the solutions I tried to add this text in .htaccess file
php_value upload_max_filesize 50M
php_value post_max_size 50M
php_value max_execution_time 1000
php_value max_input_time 1000

BUT i get an error “500 internal server error” (Also i used restart apache/php/mysql)

What should I do? Please wait for any advice.

I use Amazone Web Service with Bitnami LAMP stack . This is my location path /opt/bitnami/apache2/htdocs/suitecrm

Please add that lines in index.php and try again.

Thanks for your reply,
But it’s not working (
Have you any idea yet?

That is fresh installation?

also what is your CRM version?

suitecrm 7.11.10
it’s not fresh installation version
I byu Amozne Web Service and install LAMP stack bitnami Linux server.
Next I will transfer the installed system file from my old linux server(I copied all the files from my old server to the directory (opt/bitnami/apache2/htdocs/) of the new (LAMP bitnami) server. I also imported the old MySQL database

There CRM working fine, which you migrated?

1 Like

To be honest, I didn’t use the import function there, but now I tried to import on my old server and the error is the same.
which is remarkable, I can upload files to the system, for example, I can upload documents to the document module. also my phpinfo.php file is ok and shows the changes values (upload_file and post_max,… and other too).
what could be wrong?

Can you share all error whatever you getting during uploading.
I can upload documents to the document module(This is little bit tricky only for documents and notes modules), for rest modules you can import module to module, like contacts (old instance, exported .csv)import contacts (New instance).

it’s all error “Error. File was not uploaded successfully. It may be that the ‘upload_max_filesize’ setting in your php.ini file is set to a small number”
I get this error when i go to any module and select from left menu “Import” next i select import file (example - contact.csv) and click “next” button and i get this error " File was not uploaded successfully…"

But you told me you changed upload_max_filesize, so problem is not there, can you give 0777 permission to below folders once
and then try please.

done, but it’s not working, i still gor the same error (

have you any idea how to fix this yet?

i have fixed this issue.
in config.php(in my suitecrm local file) I changed the value ‘upload_maxsize’ => ‘60MB’, to ‘upload_maxsize’ => ‘30000000’
Please close the topic

Just as a clarification - you’re not supposed to use values like 60MB in php.ini, they should be written as 60M, without the B

1 Like

I figured it out for myself, most of the times the settings in php.ini are correct yet the error message appears.

For me it was the encoding of the csv file: change it from unicode to ANSI and the upload will work ot the other way around. (Notepad - Save as - right bottom option).

In a combination with SELinux which prohibited the upload:


sudo chown apache:apache -R /data/www/html/sites/mysite

cd /data/www/html/sites/mysite

File permissions, recursive

find . -type f -exec chmod 0644 {} ;

Dir permissions, recursive

find . - type d -exec chmod 0755 {} ;

SELinux serve files off Apache, resursive

sudo chcon -t httpd_sys_content_t /data/www/html/sites/mysite -R

Allow write only to specific dirs

sudo chcon -t httpd_sys_rw_content_t /data/www/html/sites/mysite/logs -R
sudo chcon -t httpd_sys_rw_content_t /data/www/html/sites/mysite/uploads -R

The directories that need write access are

cache custom modules themes data upload