file upload not working

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
sdabel
Posts: 3
Joined: Feb 20, 2005 8:16 pm

file upload not working

Post by sdabel »

I can't get the file upload to work in Manits. Whenever I try to upload a file I get:

APPLICATION ERROR #15

File upload failed. PHP file uploads may be disabled. Please ask your admin to run the admin_check script to debug this problem.


When I run check.php I get:

File Uploads
File uploads are ENABLED.
File uploads will be stored in the DATABASE.

The following size settings are in effect. Maximum upload size will be whichever of these is SMALLEST.
PHP variable 'upload_max_filesize': 2000000 bytes
PHP variable 'post_max_size': 8000000 bytes
Mantis variable 'max_file_size': 5000000 bytes


Mantis 0.19.2 on IIS 5.0
MySQL 4.0.20 is on a seperate Solaris box
PHP is 4.3.10

I have given my mantis account on MySQL full rights.

Any ideas ?

regards
sean

thraxisp
Developer
Posts: 509
Joined: Feb 13, 2005 10:38 pm
Location: Ottawa, Canada
Contact:

Post by thraxisp »

You may want to file this in the bug tracker.

The error is specifically that the file uploaded is not accessible to the script. Might the server be running is SAFE MODE?

sdabel
Posts: 3
Joined: Feb 20, 2005 8:16 pm

Post by sdabel »

Thanks for the swift reply. I can confirm that Safe mode=off

I guess it could be a bug however in most cases I find the problem is in the configuration (ie me!)

regards
sean

sdabel
Posts: 3
Joined: Feb 20, 2005 8:16 pm

further info

Post by sdabel »

I have done some more investigation.
When I use the DISK method of uploads I get the same error. I created an upload directory with write access. When the permissions are wrong matis gives the appropriate error so I beleive that it is attempting to write to the correct location.

Other php applications on the same system (dotproject) are able to upload files.

So php can upload, and my config settings seem correct. Perhaps this is a bug?

regards
sean

mike
Posts: 6
Joined: Feb 26, 2005 4:40 pm

Post by mike »

I think I am having the same problem, sdabel.

I'm running 0.19.2 on IIS 6.0 with PHP 4.3.10. The database is MySQL 4.0.21 on a separate machine.

Running the /admin/check.php reports the same as sdabel, but I get APPLICATION ERROR #15 when trying to upload any files.

I turned on detailed error reporting for some extra information:
Full path: C:\Inetpub\wwwroot\mantis\htdocs\core\file_api.php
Line: 501
Variable Value Type
p_bug_id 0 string
p_tmp_file C:\WINDOWS\TEMP\php18.tmp string
p_file_name MyFile.doc string
p_file_type application/octet-stream string
p_table project string
p_title TEST string
p_desc string

Filename Line Function Args
C:\Inetpub\wwwroot\mantis\htdocs\core\file_api.php 501 trigger_error ( '15', 256 )
C:\Inetpub\wwwroot\mantis\htdocs\proj_doc_add.php 48 file_add ( 0, 'C:\WINDOWS\TEMP\php18.tmp', 'MyFile.doc', 'application/octet-stream', 'project', 'TEST', '' )
It looks to me that the file is successfully being received into the TEMP directory, but an error occurs after that.

On a different server, I run Mantis 0.19.0 on IIS 4.0 with PHP 4.3.9 against the same database (I'm in the process of upgrading to 19.2 on a faster server -- once uploading works!) and file uploading works fine.

On the IIS 6.0 server, file uploading works in other PHP scripts, but not Mantis at the moment.

Any ideas?

mike
Posts: 6
Joined: Feb 26, 2005 4:40 pm

Post by mike »

I did a little further investigating.

On the IIS 6.0 server, I copied my 0.19.0 installation over and file uploading worked. I tried testing a 0.19.1 installation and file uploading did not work.

On the IIS 4.0 server, I copied my 0.19.2 installation over and file uploading worked.

It seems IIS 6.0 doesn't like Mantis 0.19.1+.

Now I have a dilema -- do I want the faster server, or the new features of 0.19.2?? :-)

thraxisp
Developer
Posts: 509
Joined: Feb 13, 2005 10:38 pm
Location: Ottawa, Canada
Contact:

Post by thraxisp »

This may be a permissions error. The specific error is because the file (once uploaded) is not readable by the Mantis php code.

mike
Posts: 6
Joined: Feb 26, 2005 4:40 pm

Post by mike »

thraxisp wrote:This may be a permissions error. The specific error is because the file (once uploaded) is not readable by the Mantis php code.
This is interesting now. I added user "Everyone" with "Read" permission to my C:\WINDOWS\Temp folder and 0.19.2 file uploading now works.

So here's the question: What does 0.19.1+ do differently then 0.19.0 to handle file uploads? And differently then PHP apps in general? Why is this neccessary? Because 0.19.0 and other PHP apps worked all along.

Also, what specific user needs "Read" permission on Windows\Temp for 0.19.1+ uploads to work? I just used "Everyone" as a catch-all, but would like to have the exact user instead.

sdabel, does doing the same fix your installation as well?

jslater
Posts: 1
Joined: Mar 09, 2006 11:43 am

Still can't upload files :-(

Post by jslater »

I thought I had this resolved when I upgraded Mantis to 1.0.1, but I guess not.

I’m having problems uploading files. When I click “Upload File” I just get a blank screen, the URL changes to bug_file_add.php then nothing happens.

I’ve uploaded larger files so I don’t believe this is a file size issue. (Besides, when I try to upload a file that too big, I get a message telling me the file is too big.)

I did read a similar issue in the Mantis forum, but no real solution.

Here’s my config:

Mantis 1.0.1
Fedora Core 4 2.6.15-1.1833_FC4
PHP 5.0.4-10.5

My from ‘admin’ screen:
PHP variable 'upload_max_filesize': 2000000 bytes
PHP variable 'post_max_size': 8000000 bytes
Mantis variable 'max_file_size': 5000000 bytes

The file I’m trying to upload an 800k .pdf file.

I just ran a quick test and was able to upload a larger .jpg file… No problem…

Can anyone help?

Thanks!

Jon

tometasoftware
Posts: 1
Joined: Mar 17, 2006 11:51 pm
Location: Spokane, WA
Contact:

File upload issue: Fixed

Post by tometasoftware »

We run IIS 6.0
Mantis 1.0 stable

Had the file upload problem.

Give the IUSR_%MACHINENAME% write permissions to c:\windows\temp

This worked for us.

Cheers!

Post Reply