File Uploading not Working MantisBT 2.22.0 on Windows Server

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
tomsnunes
Posts: 7
Joined: Aug 08, 2019 6:34 am
Location: São Paulo, Brazil

File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by tomsnunes » Oct 07, 2019 6:53 am

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!
Mantis: 2.22.0
PHP: FastCGI 7.1.29
SQL: 8.0.17.0
OS: Windows Server 2012 R2
Web Server: IIS 6.2

cas
Posts: 660
Joined: Mar 11, 2006 11:08 am
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas » Oct 07, 2019 7:45 am

Just to be sure, what is stated in php.ini?
does it look like :
upload_max_filesize=2048M

tomsnunes
Posts: 7
Joined: Aug 08, 2019 6:34 am
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by tomsnunes » Oct 07, 2019 8:11 am

cas wrote:
Oct 07, 2019 7:45 am
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
Mantis: 2.22.0
PHP: FastCGI 7.1.29
SQL: 8.0.17.0
OS: Windows Server 2012 R2
Web Server: IIS 6.2

cas
Posts: 660
Joined: Mar 11, 2006 11:08 am
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas » Oct 07, 2019 8:23 am

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?

amphetamine
Posts: 56
Joined: Jun 04, 2019 7:17 pm

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by amphetamine » Oct 07, 2019 8:45 am

DON'T forget to restart apache server after changing php.ini file!

tomsnunes
Posts: 7
Joined: Aug 08, 2019 6:34 am
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by tomsnunes » Oct 07, 2019 9:13 am

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.
Mantis: 2.22.0
PHP: FastCGI 7.1.29
SQL: 8.0.17.0
OS: Windows Server 2012 R2
Web Server: IIS 6.2

cas
Posts: 660
Joined: Mar 11, 2006 11:08 am
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas » Oct 07, 2019 11:32 am

You list 2 php versions. Which one is used and is the corresponding php.ini in line?

tomsnunes
Posts: 7
Joined: Aug 08, 2019 6:34 am
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by tomsnunes » Oct 07, 2019 11:36 am

cas wrote:
Oct 07, 2019 11:32 am
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.
Mantis: 2.22.0
PHP: FastCGI 7.1.29
SQL: 8.0.17.0
OS: Windows Server 2012 R2
Web Server: IIS 6.2

tomsnunes
Posts: 7
Joined: Aug 08, 2019 6:34 am
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by tomsnunes » Oct 08, 2019 6:39 am

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
Mantis: 2.22.0
PHP: FastCGI 7.1.29
SQL: 8.0.17.0
OS: Windows Server 2012 R2
Web Server: IIS 6.2

cas
Posts: 660
Joined: Mar 11, 2006 11:08 am
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas » Oct 08, 2019 9:47 am

Thanks for posting the fix, can be useful or others too :D

Post Reply