The data folder must be 0777 chmod completely (and its subdirectories). I would guess that textfile doesn't have 0777 chmod.
I just looked, and both the data and internal_data folders (and the countryflags sub-folder) are 777. Inside countryflags, the cloudflare-cookie.txt file is 644, GeoLite2-Country.mmdb and index.html files in the countryflags folder are both 666.SBJ is correct. The data directory and all of it's subdirectories should be world writable.
The owner of the folders and files should be whatever user your PHP installation runs as.
The ONLY time you can get away with permissions other than 777 is when your PHP installation for your site runs as a unique user on your server (note that www-data or some such user is not usually a unique user/group). Such as, on one of my sites the owner is WEB2 and the group is CLIENT0. So I can get away with 755 on the directories and 644 for files.
View attachment 212482
Owner of my data folder is root, group is 500eadmin
Owner of my countryflags folder is root, group is www-data