## The image file you tried to attach is invalid on Windows Server phpBB

Topics that doesn't fit into the other forums.
ejbarbero
Posts: 53
Joined: Sat Mar 21, 2020 7:29 pm
Contact:

### The image file you tried to attach is invalid on Windows Server phpBB

I installed phpBB on a Windows Server 2008. Neither I nor users could attach files. We got the msg "The image file you tried to attach is invalid."
I tried to change my avatar. I got the msg "Temporary folder could not be found or is not writable."
So I went nuts trying to provide the (Linux 777 equivalent on Windows) permissions for the places where I thought this files could be written incluring /uploads, /temp, /tmp by doing this:
On the server > File Explorer, right click on /files > Properties > Sharing > Advanced Sharing > check Share this folder > Permissions > Allow > Full control > OK > OK > Close.
Then on IIS > Sites > your site > restart.
And just in case IIS > application pol > your site > stop, wait a few seconds > start.
Nah! it did not work.
Then I tried adding a web.config file in each of those folders. Nah!

Finally, I found the SOLUTION:
Create a folder named \tmp somewhere, such as in the root, like C:\, or like I did, in the folder where my forum installations is, whatever.
Do not need to make this folder write-able.
The killer is this:
Go to the folder where you have PHP installed, not phpBB, PHP itself, in my case \php-7.4.4-Win32-vc15-x64 and edit this file:

Code: Select all

\phi.ini
In php.ini, find this:

Code: Select all

;sys_temp_dir =""
and change it to this:

Code: Select all

sys_temp_dir = "complete path to your \tmp file"
Save it.
Then on IIS > Sites > your site > restart.
Done! Problem solved! OMG! Can you see the avatar I just uploaded?
Attachments
Mountaineer_avatar.jpg (4.67 KiB) Viewed 267 times