Got “The file exceeds the maximum allowed file size. [Code 2]”, while attempting to import CSV, despite my PHP.ini being set correctly, even according to this topic.
I’ve even tried uploading a zero-byte file, though that ended up with Code 4.
I’m also facing this error and I’ve noticed it’s because the maximum file size specified in “value” should be a power of 2. In particular, I was setting value=“500000” and I’ve turned it to value=“524288”
Apparently something wrong with converting 2G to whatever number PHP likes in the upload form?
In the Media Uploader (which works) this field is: 2147483648, but isn’t included as MAX_FILE_SIZE.
Could you perhaps send me the .csv file via private message so I can try it in our environment?
Alternatively you could order demo cms instance hosted with spring signage and try to recreate the issue there - that should help us to know where the problem could be.
Ah… file upload types are limited in this install of Discourse.
Have a paste!
This file does suffer a bit from MS Excel adding SmartQuotes and other such characters, but the issue occurs before the actual import, so I figure it’s fine.
Side note: This file (even with special characters removed) will fail to import, because for some reason the value column in the database is set to 255 characters, and there are quite a few description cells that are much longer than that (almost double even).
1.7.9 does have that limit to 255 characters in a field - 1.8 does not have this problem anymore.
Other than that I imported your csv without any issues - the descriptions are cut if they were longer than 255 characters, but that’s only issue I had.
Yeah, everything seems fine as indicated by the non-problem with the media upload section.
My settings are as follows:
php.ini:
post_max_size = 2G
upload_max_filesize = 2G
nginx.conf:
client_max_body_size 2G;
I’m pretty sure it’s just a glitch in how PHP is interpreting the form parameter MAX_FILE_SIZE that appears only in the CSV importer and not in the media upload tool, as the moment I modify the DOM to eliminate it from the submission, it works. It’s possible it works in other situations because the calculations for 500M or 20M or whatever do correctly expand out to whatever PHP is expecting, but 2G does not.
I believe we’ve encountered some issue when the limits were set to 2G (or more), you could try to go with 1999M that’s what we have in our cloud hosting settings as well as I believe in docker.