xoops forums

luciorota

Module Developer
Posted on: 9/12 12:13
luciorota
luciorota (Show more)
Module Developer
Posts: 180
Since: 2007/4/20
#1

Xoops uploader

Hi
In my experience XoopsMediaUploader class does not support miltiple uploads.

For example, how can I upload files in this case?

...
$formFile = new XoopsFormFile('files''files[]'0);
$formFile->setExtra('multiple''multiple');
...


Someone can suggest me a solution?

Mamba

Moderator
Posted on: 9/12 15:18
Mamba
Mamba (Show more)
Moderator
Posts: 10610
Since: 2004/4/23
#2

Re: Xoops uploader

Will this help?
https://xoops.org/modules/newbb/viewtopic.php?post_id=363553
Support XOOPS => DONATE
Use 2.5.9 | Docs | Modules | Bugs

luciorota

Module Developer
Posted on: 9/12 20:12
luciorota
luciorota (Show more)
Module Developer
Posts: 180
Since: 2007/4/20
#3

Re: Xoops uploader

This code works

for ($i 0$i count($_FILES['files']['name']); $i++) {
    echo 
"[{$i}]";
    if (
$uploader->fetchMedia('files'$i)) {
        if (!
$uploader->upload()) {
            echo 
$uploader->getErrors();
        } else {
            echo 
'<h4>File uploaded successfully!</h4>';
            echo 
'Saved as: ' $uploader->getSavedFileName() . '<br>';
            echo 
'Full path: ' $uploader->getSavedDestination();
        }
    } else {
        echo 
$uploader->getErrors();
    }
}

Mamba

Moderator
Posted on: 9/22 2:39
Mamba
Mamba (Show more)
Moderator
Posts: 10610
Since: 2004/4/23
#4

Re: Xoops uploader

Thanks for submitting your pull request:
https://github.com/XOOPS/XoopsCore25/pull/593
Support XOOPS => DONATE
Use 2.5.9 | Docs | Modules | Bugs