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

  • luciorota

  • Module Developer

  • Posts: 216

  • 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: 11409

  • Since: 2004/4/23


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

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

  • luciorota

  • Module Developer

  • Posts: 216

  • 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 
'

File uploaded successfully!

'
;
            echo 
'Saved as: ' $uploader->getSavedFileName() . '
'
;
            echo 
'Full path: ' $uploader->getSavedDestination();
        }
    } else {
        echo 
$uploader->getErrors();
    }
}

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

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


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

Login

Who's Online

259 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 259


more...

Donat-O-Meter

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

Latest GitHub Commits