Page 1 of 1

File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 11:53
by tomsnunes
Hello guys

I am in need of some help. I have a MantisBT 2.22.0 instance running on Windows Server 2012 R2 and everything is working fine except file uploads above 30 MB .

This is my config_inc.php file:

# --- Attachments / Upload ---
$ g_allow_file_upload = ON;
$ g_file_upload_method = DISK;
$ g_max_file_size = 2048000000;
$ g_preview_attachments_inline_max_size = 256 * 1024;
# $ g_allowed_files = ''; '
# $ g_disallowed_files = '';
$ g_absolute_path_default_upload_folder = "C: \ inetpub \ wwwroot \ develop \ uploads \ projects \\";
$ upload_tmp_dir = 'C: \ mantis \ tmp \\';

The file upload is working fine if the file is under 30 MB, but I need to upload much larger files.
The permissions seem correct too for the upload folder by project.

Sometimes I receive the following error message while trying to attach a file:
" The server responded with code 0 "

But other times I receive the following message:
" 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. "

My PHP.ini settings is allowing files above 2048 MB to be uploaded and there are no errors or warnings while checking mantisbt / admin / check / index.php.

Does anybody have faced a similar situation?

Thank you!

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 12:45
by cas
Just to be sure, what is stated in php.ini?
does it look like :
upload_max_filesize=2048M

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 13:11
by tomsnunes
cas wrote: 07 Oct 2019, 12:45 Just to be sure, what is stated in php.ini?
does it look like :
upload_max_filesize=2048M
My settings are the following:

memory_limit = 2048M
post_max_size = 2048M
upload_max_filesize = 2048M

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 13:23
by cas
That at least looks good. How are you connected to the local network, perhaps Wifi times out with very large files?
Is this happening with multiple browsers?

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 13:45
by amphetamine
DON'T forget to restart apache server after changing php.ini file!

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 14:13
by tomsnunes
I'm using IIS as webserver. I've restarted the service but no effect until now.
All machines are connected via lan cable and I've tested upload of files though Chrome, Firefox and Opera all of them showing the same result.
Can't upload files above 30 M.

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 16:32
by cas
You list 2 php versions. Which one is used and is the corresponding php.ini in line?

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 07 Oct 2019, 16:36
by tomsnunes
cas wrote: 07 Oct 2019, 16:32 You list 2 php versions. Which one is used and is the corresponding php.ini in line?
Our MantisBT instance is running in a server with PHP 7.1.29.

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 08 Oct 2019, 11:39
by tomsnunes
After sometime searching for a fix to my situation, I've discovered that IIS has a specific setting "maxAllowedContentLength" which was causing my issue.

I have been able to fix this though this powershell command:

Code: Select all

Set-WebConfigurationProperty -filter /system.webserver/security/requestfiltering/requestLimits -name maxAllowedContentLength -value 134217728
Thank you again to all of you guys! :D

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Posted: 08 Oct 2019, 14:47
by cas
Thanks for posting the fix, can be useful or others too :D