1
luciorota
Xoops uploader
  • 2018/9/12 12:13

  • luciorota

  • Module Developer

  • Posts: 212

  • Since: 2007/4/20


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?

2
Mamba
Re: Xoops uploader
  • 2018/9/12 15:18

  • Mamba

  • Moderator

  • Posts: 11251

  • Since: 2004/4/23


Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
luciorota
Re: Xoops uploader
  • 2018/9/12 20:12

  • luciorota

  • Module Developer

  • Posts: 212

  • Since: 2007/4/20


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();
    }
}

4
Mamba
Re: Xoops uploader
  • 2018/9/22 2:39

  • Mamba

  • Moderator

  • Posts: 11251

  • Since: 2004/4/23


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

Login

Username:
Password:

Lost Password? Register now!

Who's Online

48 user(s) are online (28 user(s) are browsing Support Forums)


Members: 0


Guests: 48


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits