Upload multiple media at once
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 2
- Joined: 06 Aug 2021, 16:57
Upload multiple media at once
Hi,
I'm very new to aimeos! Is adapting the default admin panels upload function, to allow for multiple uploads at once possible?
It's very inconvenient to have to press the "+" button individually, for each new product photo. Instead I'd like to be able to simply press it once, select all the photos desired for upload, and have the repetitive parts done for me in the background.
Basically a bulk media upload option.
Any help is greatly appreciated!
Thanks.
UPDATE:
PHP 7.3.27-1~deb10u1 (cli) (built: Feb 13 2021 16:31:40) ( NTS )
Newest Stable Aimeos (pre-built store) (as of 6th August 2021)
Windows (But running server on Debian WSL)
I'm very new to aimeos! Is adapting the default admin panels upload function, to allow for multiple uploads at once possible?
It's very inconvenient to have to press the "+" button individually, for each new product photo. Instead I'd like to be able to simply press it once, select all the photos desired for upload, and have the repetitive parts done for me in the background.
Basically a bulk media upload option.
Any help is greatly appreciated!
Thanks.
UPDATE:
PHP 7.3.27-1~deb10u1 (cli) (built: Feb 13 2021 16:31:40) ( NTS )
Newest Stable Aimeos (pre-built store) (as of 6th August 2021)
Windows (But running server on Debian WSL)
Re: Upload multiple media at once
You can add a multiple file upload control here:
https://github.com/aimeos/ai-admin-jqad ... rd.php#L31
Then, you have to add a few lines of code to loop over the files here:
https://github.com/aimeos/ai-admin-jqad ... d.php#L363
We would appreciate a pull request with your changes very much and will merge it into the core
https://github.com/aimeos/ai-admin-jqad ... rd.php#L31
Then, you have to add a few lines of code to loop over the files here:
https://github.com/aimeos/ai-admin-jqad ... d.php#L363
We would appreciate a pull request with your changes very much and will merge it into the core
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 2
- Joined: 06 Aug 2021, 16:57
Re: Upload multiple media at once
Hi, thanks for your reply!
I've gone through the files you referenced, but I'm not sure that I understand the way (https://github.com/aimeos/ai-admin-jqad ... d.php#L363) works in relation to the input form...
I've edited the first file, you linked to; I added the relevant code to allow for multiple files to be uploaded... (See below)
(https://github.com/JTD420/ai-admin-jqad ... hp#L68-L70)
If you could offer me some additional help, in how to go about looping through the results of this, in order to store multiple files, I'd really appreciate it! And of course, I'll happily submit a pull request, should I manage to get it working, that is..
(I was looking at code examples, such as this one.. So I know at a base level, fundamentally, this should be incredibly simple... )
https://makitweb.com/multiple-files-upl ... -with-php/
I've gone through the files you referenced, but I'm not sure that I understand the way (https://github.com/aimeos/ai-admin-jqad ... d.php#L363) works in relation to the input form...
I've edited the first file, you linked to; I added the relevant code to allow for multiple files to be uploaded... (See below)
(https://github.com/JTD420/ai-admin-jqad ... hp#L68-L70)
If you could offer me some additional help, in how to go about looping through the results of this, in order to store multiple files, I'd really appreciate it! And of course, I'll happily submit a pull request, should I manage to get it working, that is..
(I was looking at code examples, such as this one.. So I know at a base level, fundamentally, this should be incredibly simple... )
https://makitweb.com/multiple-files-upl ... -with-php/
Re: Upload multiple media at once
This won't give your the desired result because it will upload multiple files for one media item. There might be a much better solution which requires a few lines of HTML and JS only:JakeTheDog420 wrote: ↑07 Aug 2021, 21:02 I've edited the first file, you linked to; I added the relevant code to allow for multiple files to be uploaded... (See below)
(https://github.com/JTD420/ai-admin-jqad ... hp#L68-L70)
1.) Add a hidden multiple file input field and change the <div> to a <label> with a "for" attribute, so the file dialog is automatically opened when the label is clicked:
https://github.com/JTD420/ai-admin-jqad ... #L248-L251
Code: Select all
<label for="media-multiple-add" class="btn btn-primary btn-card-more act-add fa" ... v-on:change="addMultiple($event)"></label>
<input type="file" id="media-multiple-add" style="display:none"/>
https://github.com/aimeos/ai-admin-jqad ... ux.js#L183
Use the DataTransfer API of the browser to move the files to from the multiple file dialog to the single file dialogs:
https://stackoverflow.com/questions/425 ... ther-input
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star