View Issue Details

IDProjectCategoryView StatusLast Update
0008043mantisbtbugtrackerpublic2008-10-28 21:11
ReporterBabass Assigned To 
Status newResolutionopen 
Product Version1.0.7 
Summary0008043: Upload file is impossible in safe mode

We get an error 15 and/or 504(not sure of this numbers) in safe mode when trying to upload file.


File upload failed. File is not readable by Mantis. Please check the project settings

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section."

Steps To Reproduce

Install mantis in a safe mode PHP
Activate upload (any configuration for uploads should make this error message)
Upload a file in a bug

Additional Information

in core/file_api.php, I had to unactivate the lines:
if ( !is_readable( $p_tmp_file ) ) {
around 507, and
$t_file_size = filesize( $p_tmp_file );
if ( 0 == $t_file_size ) {
around 550.
Is readable should be replaced by is_uploaded_file.
filesize should be done after the upload of a file.

TagsNo tags attached.




2007-06-09 11:09

manager   ~0014722

It would be great if you can upload a zipped copy of the file_api.php after modification.



2007-06-09 11:46

reporter   ~0014728

I just commented the lines...



2008-10-28 21:11

reporter   ~0019722


I have the same problem. I looked at your suggestions above and was about to do the same. However, it occurred to me that I had it worked on my test environment with the exact same installation. I did some investigation and found that all I need to do is just create a folder and set appropriate permission on that folder then modify this entry "upload_tmp_dir" in php.ini to point to my folder and reset my web server and it worked. Hope it will help someone with the same problem. Mind you that I did in Windows environment and I think it should do the trick for Linux env.

Issue History

Date Modified Username Field Change
2007-06-08 06:45 Babass New Issue
2007-06-09 11:09 vboctor Note Added: 0014722
2007-06-09 11:46 Babass Note Added: 0014728
2008-10-28 21:11 mnguyen Note Added: 0019722