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: 08 Aug 2019, 11:34
Location: São Paulo, Brazil

File Uploading not Working MantisBT 2.22.0 on Windows Server

Post 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!
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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas »

Just to be sure, what is stated in php.ini?
does it look like :
upload_max_filesize=2048M
tomsnunes
Posts: 7
Joined: 08 Aug 2019, 11:34
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post 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
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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post 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?
amphetamine
Posts: 113
Joined: 05 Jun 2019, 00:17

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by amphetamine »

DON'T forget to restart apache server after changing php.ini file!
tomsnunes
Posts: 7
Joined: 08 Aug 2019, 11:34
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post 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.
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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas »

You list 2 php versions. Which one is used and is the corresponding php.ini in line?
tomsnunes
Posts: 7
Joined: 08 Aug 2019, 11:34
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post 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.
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: 08 Aug 2019, 11:34
Location: São Paulo, Brazil

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post 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
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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: File Uploading not Working MantisBT 2.22.0 on Windows Server

Post by cas »

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