After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Ivan Heran -
Number of replies: 12

Hi, after upgrade to 2.3.1 I cannot upload files. Each time receiving:

Error: The file ..... has no data in it - did you try to upload a folder?


I think permissions to folder moodledata is ok, in previous versions everything worked. Using Apache2 on Ubuntu server.

Any suggestions. Thank you.

Average of ratings: -
In reply to Ivan Heran

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Ivan,

I've tried searching moodle.org and the Moodle Tracker for the error you mention and came up with no results at all, apart from your forum post and issue report MDL-34681. Tons of sites have upgraded 1.9 -> 2.2 -> 2.3.1 so it's very weird that nobody else has come across the same problem. Can you think of anything at all which might have caused it? Did you follow the Upgrading documentation exactly? Unfortunately developers won't be able to investigate MDL-34681 unless they have a way of reliably reproducing the problem.


 

In reply to Helen Foster

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Ivan Heran -

Hi Helen,

thanks for your information. I tried to change many parameters and settings in according with upgrade documents, but no success. It is frustrating, that this kind of error message is not possible to find in forum or on the internet. I cannot beleive, that I am the first one, who received this message.

I will continue with research, if no success, I will be unhappy, but I have to go back to 1.9  sad

Ivan

In reply to Ivan Heran

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Guillermo Madero -

Hi Ivan,

The problem you're having might be caused because the server is imposing a limit on the file upload size. Here are some suggestions:

  • Turn on debugging: http://docs.moodle.org/23/en/Debugging.
  • Check your server logs.
  • Go to Site administration > Server > PHP info, and check the values of the upload_max_filesize and the post_max_size parameters.
  • If you have access to the php.ini configuration file, you could increase those values, for example:
    • upload_max_filesize = 64M
    • post_max_size = 64M
  • If you cannot access that file, but your server allows using a custom php.ini file, you could create one at your moodle installation folder with the aforementioned two lines.
  • If you cannot create a custom php.ini file, but your server allows using an .htaccess (dot htaccess) file, you could create one at your moodle installation folder with the following two lines:
    • php_value upload_max_filesize 64M
    • php_value post_max_size 64M

Hope this helps. 

In reply to Guillermo Madero

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Ivan Heran -

Hi, thanks for your reccomendation, I had these values set to 50M, changed it to 64M, but certainly no effect, because I am trying to upload very small PDF files and the error message is still the same sad

In reply to Ivan Heran

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The little routine that generates that error has this comment at the top
 
* Checks the contents of the given file is not completely NULL - this can happen if a
* user drags & drops a folder onto a filemanager / filepicker element


You might want to turn on Debugging and see if you get further warnings or notices.
In reply to Howard Miller

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Thelma Polanco-Perez -

Hi Howard,

So that means that Moodle 2.3.1 doesn't allow you drag & drop folders? If I drag any individual or multiple files the system works fine but if I drag a folder I got an error (see image)

Thanks,
Thelma smile

Attachment folder_upload.JPG
In reply to Thelma Polanco-Perez

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Correct - you can not drag a folder into Moodle.  This is actually a restriction of the browser technology, not Moodle itself.  There is no way we can implement support for that until the browsers support it.

Average of ratings: Useful (1)
In reply to Martin Dougiamas

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Thelma Polanco-Perez -

Hi Martin,

Thanks for getting back on this issue. We're live on 2.3.1 now and were wondering if that could be possible as we'll start workshops and training for our faculty.

It was good to see you @the Moot!

Thelma

In reply to Ivan Heran

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Alexey Neizvestny -

I think the problem in access right to temporary directory for HTTP uploaded files. Check php.ini -> upload_tmp_dir

upload_tmp_dir

Average of ratings: Useful (1)
In reply to Alexey Neizvestny

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Ivan Heran -

Thanks for your reccomendation. My upload folder is /tmp (in php.ini upload_tmp_dir variable), there are rights 40777, it was th same in previous version and everything worked sad

In reply to Ivan Heran

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Ivan Heran -

The problem was found:

Thanks for all your posts. In full debugging mode I found the problem. It was open_basedir restriction, which was protecting /tmp folder and it was not accessible !!! When I changed upload_tmp_dir in php.ini to  ..... /moodledata/temp , upload was working.

I have no idea, why this was not a problem in Moodle 1.9.x, anyway, finally I used  ....open_basedir "/var/www/moodle/moodledata:/tmp" and no need to chage upload_tmp_dir in php.ini.

Thanks.

Ivan

Average of ratings: Useful (2)
In reply to Ivan Heran

Re: After upgrade 1.9 - > 2.2 -> 2.3.1 - upload problem

by Lucas Taylor -

Hey, i have the same problem, but i dont know where did you find "open_basedir", where are this value ?

Please, its urgent. I cant upload files, where i find the file to change the open_basedir ?