Illustration of connected portfolio elements

Portfolios for your
learning community

Try out Mahara

Create portfolios

Using Mahara, students and staff create their personal learning stories by uploading evidence of activities they have participated in, and embedding publicly accessible content they have previously put online. They can write reflections on their experiences that frame this evidence, map it to competencies or registration requirements, and provide necessary context.

Mahara can be used for many different portfolio purposes, such as study, professional development, work-integrated learning, assessment, showcase and presentation, and employability.

Learn about the portfolio options

Illustration of a person with their portfolio
Illustration of a paper airplane representing sharing

Share work

Mahara allows portfolios to be shared flexibly with one person, a specific group of people, or the entire world. Access can be further restricted to a particular time frame or just within an assessment task.

Find out about sharing portfolios

Engage with others

Mahara makes it easy to comment and give feedback. Portfolios can also be submitted to learning management systems via LTI (Learning Tools Interoperability) for marking.

Groups in Mahara allow people to create portfolios collaboratively and engage in forum discussions.

Learn about collaborating in Mahara

Illustration of a group of people collaborating
Illustration of a podcast logo

Listen to portfolio stories

In our podcast 'Create. Share. Engage.' portfolio practitioners, researchers, learning designers, and portfolio authors share their journey. Learn how they navigate the many different facets of portfolios in general, and Mahara specifically.

Listen on the podcast website or in your favourite app

Mahara Community

Upload fails with UPLOAD_ERR_FORM_SIZE

anonymous profile picture
Account deleted
Posts: 6
27 February 2014, 3:11

I am running Mahara 1.8.1 on x86_64 Debian  7.0 with Apache 2.2.22, PHP 5.4.4 and MySQL 5.5.35.

upload_max_filesize is set to 5000M

post_max_size is set to 5000M

(I verified this with a phpinfo(); from the mahara directory)

When uploading a file with the embedded media block the upload fails with UPLOAD_ERR_FORM_SIZE (well, the error message is "The file was too big. Please ask your administrator for more information.", but I made lib/uploadmanager.php return the error code, which is UPLOAD_ERR_FORM_SIZE).

I have no idea where and how the form size is set. I looked at artefact/file/theme/raw/form/filebrowser.tpl and MAX_FILE_SIZE is set to $phpmaxfilesize which in turn is 5242880000 so I don't see how it could fail.

The file itself is 2,4GB so it shouldn't really be a problem.

If anyone has any pointers on what I could be missing here I'd really appreciate it :)

Dominique-Alain JAN's profile picture
Dominique-Alain JAN
Posts: 755
27 February 2014, 4:06

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

Hello,

Have your checked the parameters in your File's artefact plugin. You can find information about this in the user manual: http://manual.mahara.org/en/1.8/administration/extensions.html; under "9.6.1.5. Artefact type: File".

-dajan

anonymous profile picture
Account deleted
Posts: 6
04 March 2014, 22:58

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

Yeah, I did. The linked PDF file shows all my file extension settings (sorry about the german locale).

http://user.phil-fak.uni-duesseldorf.de/~pranaitis/mahara1.pdf

A post by Account deleted was deleted
Aaron Wells's profile picture
Aaron Wells
Posts: 896
05 March 2014, 12:32

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

That is strange. The error UPLOAD_ERR_FORM_SIZE is supposed to indicate that the file uploaded is larger than the value of the MAX_FILE_SIZE directive that was sent as part of the HTTP request (due to it being in a hidden form field).

I'd recommend this:

1. If you haven't already, look at the HTML source of the generated page to verify for sure what the final value of the "MAX_FILE_SIZE" hidden form field is.

2. Since you're already experimenting with modifying the PHP files, just eliminate the MAX_FILE_SIZE form field, and then see if it works.

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 6
05 March 2014, 22:56

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

Good idea!

I checked the MAX_FILE_SIZE and it's set to "5242875904". So I don't think that would be a problem. However removing the hidden form field allowed the upload to succeed (the "upload spinner" continued to turn, but after waiting a substantial amount of time and reloading the page the file was there and had the same md5sum).

So as a workaround commenting that hidden field is fine for now, but a more elegant solution that doesn't eliminate the "successful upload" message is still needed.

Aaron Wells's profile picture
Aaron Wells
Posts: 896
06 March 2014, 11:00

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

Hm, so your MAX_FILE_SIZE was large enough, but it still errored out. That sounds like a bug in PHP. Are you on a 32-bit system? The largest signed integer in 32-bit PHP is roughly 2 billion, and your MAX_FILE_SIZE is roughly 5 billion, so perhaps that could be the cause of the problem.

Regardless, after readnig up on the subject in appears that MAX_FILE_SIZE is unnecessary anyway. It's supposed to be provided so that the web browser can read it from the form and prevent the upload on the client side. But in practice, no current web browser actually does this. Which makes MAX_FILE_SIZE redundant, because we already use other means to enforce the size limit after the file has been uploaded.

Which leads me to think that maybe we should just remove the MAX_FILE_SIZE parameter altogether.

anonymous profile picture
Account deleted
Posts: 6
11 March 2014, 23:24

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

No, I'm runnnig a 64bit system, I also suspected some problem with 32bit integers, but PHP_INT_MAX is 9223372036854775807 and PHP_INT_SIZE is 8.

If MAX_FILE_SIZE is redundant removing it sounds like a good idea.

anonymous profile picture
Account deleted
Posts: 2
21 March 2014, 12:06

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

I experienced the same problem as Jens and Aaron's workaround of removing MAX_FILE_SIZE hidden form field worked for me too. Thank you for the info. 

Specifically, I edited /artefact/file/theme/raw/form/filebrowser.tpl. In my case though, the usual "successful upload" message is not lost.

My Mahara instance is on a system similar to Jens' (Mahara 1.8.1 on x86_64 Debian 7.4 with Apache 2.2.22, PHP 5.4.4 and MySQL 5.5.35) and I test with Google Chrome on OS X. It was installed at 1.6 and the issue emerged at upgrade to 1.7 or 1.8.

anonymous profile picture
Account deleted
Posts: 2
18 April 2015, 22:32

Re: Upload fails with UPLOAD_ERR_FORM_SIZE

In Mahara 15.04, the element

<input type="hidden" name="MAX_FILE_SIZE" value="{$phpmaxfilesize}" />

has been move to 

  • Line 45, htdocs/theme/raw/artefact/file/templates/form/filebrowser.tpl