Moodle

Ability to attach more than one file to a forum post

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Forum
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

Users have requested ability to add multiple attachments to a forum post. At present they can only do this by zipping the files. Forum post form could be redesigned to allow multiple attachments to be added up to the file size limit.

Activity

Hide
Ann Adamcik added a comment -

We're currently testing a 1.9.x patch that will allow multiple attachments to forum posts. It should be ready to attach here in the next week.

Show
Ann Adamcik added a comment - We're currently testing a 1.9.x patch that will allow multiple attachments to forum posts. It should be ready to attach here in the next week.
Hide
Ann Adamcik added a comment -

Attached is a 1.9.x patch to allow multiple attachments to forum posts. It includes a site-wide admin setting to define the maximum number of files to allow, and a forum setting to define the number of files allowed for a particular forum (up to the site max).

The zip file includes patches to several files in mod/forum, a javascript file that needs to placed in the mod/forum directory, and 2 new help files that need to go in lang/en_utf8/help/forum.

Show
Ann Adamcik added a comment - Attached is a 1.9.x patch to allow multiple attachments to forum posts. It includes a site-wide admin setting to define the maximum number of files to allow, and a forum setting to define the number of files allowed for a particular forum (up to the site max). The zip file includes patches to several files in mod/forum, a javascript file that needs to placed in the mod/forum directory, and 2 new help files that need to go in lang/en_utf8/help/forum.
Hide
Martin Dougiamas added a comment -

Ah excellent, I was in fact just working on this myself for 2.0.

2.0 code will probably be quite different though because of the new mforms elements, File API and Repository API, but I'll look at your solution, thank you.

Show
Martin Dougiamas added a comment - Ah excellent, I was in fact just working on this myself for 2.0. 2.0 code will probably be quite different though because of the new mforms elements, File API and Repository API, but I'll look at your solution, thank you.
Hide
Steve Bond added a comment -

Thanks Ann, I'll installed this here and it seems to work fine.

One thing - I noticed that with a course maximum upload size of 10MB, you can attach multiple files up to a total size greater than 10MB, and it still posts, providing no single file is bigger than 10MB. Is that by design?

Show
Steve Bond added a comment - Thanks Ann, I'll installed this here and it seems to work fine. One thing - I noticed that with a course maximum upload size of 10MB, you can attach multiple files up to a total size greater than 10MB, and it still posts, providing no single file is bigger than 10MB. Is that by design?
Hide
Ann Adamcik added a comment -

Hi Steve,

Yes, I interpreted the maximum upload size as a per-file maximum. The advanced upload assignment type works the same way - each individual file the user uploads is limited by the upload file size setting, but users can upload multiple files that exceed the maximum upload size in total.

-Ann

Show
Ann Adamcik added a comment - Hi Steve, Yes, I interpreted the maximum upload size as a per-file maximum. The advanced upload assignment type works the same way - each individual file the user uploads is limited by the upload file size setting, but users can upload multiple files that exceed the maximum upload size in total. -Ann
Hide
miri hefetz added a comment -

Hi Steve,

One thing - I noticed that if the post message is submitted with empty input file we get a notice
"Notice: Undefined index: clear in E:\Moodle\server\moodle\lib\uploadlib.php on line 225"

To prevent this notice I have added the following code in post_form.php validation
function validation($data, $files){

//remove input FILE with empty file name
foreach($_FILES as $name=>$flle){
if($file['name'] == ''){ unset($_FILES[$name]); }
}

}

Show
miri hefetz added a comment - Hi Steve, One thing - I noticed that if the post message is submitted with empty input file we get a notice "Notice: Undefined index: clear in E:\Moodle\server\moodle\lib\uploadlib.php on line 225" To prevent this notice I have added the following code in post_form.php validation function validation($data, $files){ //remove input FILE with empty file name foreach($_FILES as $name=>$flle){ if($file['name'] == ''){ unset($_FILES[$name]); } } }
Hide
Giovanni Conte added a comment -

Hi, just want to know if forumattach.zip can be used (works) with version 1.8.3?

Thank You.

Show
Giovanni Conte added a comment - Hi, just want to know if forumattach.zip can be used (works) with version 1.8.3? Thank You.

People

Vote (9)
Watch (8)

Dates

  • Created:
    Updated: