Forums | Mahara Community

Support /
Windows File Upload

Chris Richter's profile picture
Posts: 6

27 August 2009, 7:23 PM


I am running Mahara on windows and everything seems to work except uploading files.

I can upload profile icons without any problems but not upload files.

Version of Mahara is  1.1.6 (2009022617), PHP Version 5.2.4, Windows server 2003 ISAPI.

The files are uploading to the PHP temp folder correctly then disapear.

I have cheked in the  artefact/file folder and there is only the profileicons folder where the profile icons are uploading. No other folders or files are created.

 Any ideas?



Nigel's profile picture
Posts: 1643

27 August 2009, 8:29 PM

Interesting - I've seen this before somewhere, I'm pretty sure we fixed it but I can't remember what exactly the problem was.

A random guess: if you add this line to your config.php, do new uploads start working?:

$cfg->insecuredataroot = true;

Chris Richter's profile picture
Posts: 6

27 August 2009, 10:57 PM

Thanks for the quick reply.

Tried adding $cfg->insecuredataroot = true;

Didn't help.

Same problem loading files into a blog as well.

 Does the profileicons use the same upload script as the 'file' upload beacuse the profileicons upload does work?

Chris Richter's profile picture
Posts: 6

28 August 2009, 1:07 AM

I checked the file upload in a blog and it actually puts the file in the artifacts/blog/uploads folder but the web page contually shows uploading the file.

blogspot_file_pending has the file listed but doesn't go any further.





Nigel's profile picture
Posts: 1643

30 August 2009, 8:17 PM

Hi - it's a strange one, I've been racking my brains but can't remember what the problem was last time Frown

Is there any way I could get some kind of access to your system? A login to the Mahara would be a start, though even better would be ssh access. 

Chris Richter's profile picture
Posts: 6

31 August 2009, 12:02 AM

Is it anything to do with addslashes or using \\ in the php.ini for folders?

I will send some server details to you.

31 August 2009, 6:16 AM


I have just dropped in the conversation as I had exactly the same problem while installing 1.1.2 (2009-03-10) with Windows, under wampserver, before I decided to migrate it to Ubuntu.

I could install and run the previous versions in Windows without problems, so I thought that it may be some sort of bug that appeas in windows for that version.

I tried adding the line you mention in the config,php, Nigel, but the problem persists, and it is everytime you try to upload a file, It just gets stuck and there is a message saying "loading files".

However, I recently installed and test Mahara 1.1.5 in Wampserver without this problem. So whatever it causing it, it only appears in Windows but it is difficult to reproduce.




Chris Richter's profile picture
Posts: 6

31 August 2009, 7:11 PM

Ok, I spend the day tracing through where it is locking and found the code crashed here

       if (is_image_file($path)) {

            // If it's detected as an image, overwrite the browser mime type
            $imageinfo      = getimagesize($path);
           $data->filetype = $imageinfo['mime'];
            $data->width    = $imageinfo[0];
            $data->height   = $imageinfo[1];
            return new ArtefactTypeImage(0, $data);

in  artefact/file/ lib.php

If I comment this out it works...

It didn;t make any difference if it was an image file or not.

I have't gone any further to check what  is_image_file() does or what further impact this will have yet.


Nigel's profile picture
Posts: 1643

31 August 2009, 8:49 PM

Hi - that suggests that the function is_image_file is causing the crash. Do you have any way to find out any more details about the crash? Can you get access to the apache error log for your Mahara and see if there are any messages in there about it?

Nigel's profile picture
Posts: 1643

31 August 2009, 7:10 PM

Hi - I just logged in and tried it, and it worked fine. Is it still not working for you? What browser are you using, if that's the case?
12 results