Upload Button - How do you upload more than 30 files

How can I upload more than 30 images using the upload button? The button editor has a slider for max files that is limited to 30.


In my code, I used

$w ( “#mediaGalleryButton” ). fileLimit = 150 ;

hoping that it would override the button.
Unfortunately, when I run my form and select more than 30 images, the button turns red;

and my program crashes when it gets to the

w ( “#mediaGalleryButton” ). uploadFiles ()

part of my code.

Please help me get past this limitation.
Thank you.

Here’s an indirect solution.

I added a media gallery field to the dataset and uploaded the images directly to the dataset instead of using the preferred method using the form.
This method does not appear to limit the number of images.

In my code, I check if my PhotoArray is empty (return “undefined”) and if so, I feed my repeater the MediaGallery array. It works.

Here’s the code for my dynamic page

import wixData from ‘wix-data’ ;
//var locId;
$w . onReady (() => {
$w ( “#dynamicDataset” ). onReady (() => {
let locId = $w ( “#dynamicDataset” ). getCurrentItem (). _id ;
//var locId = itemObj._id;
showGallery ( locId , “#gallery1” )
$w ( “#gallery1” ). hide ();
$w ( “#gallery1” ). collapse ();
$w ( “#image” ). fitMode = “fit” ;
});

}); 

export function showGallery ( locId , myGallery ) {
console . log ( “The local ID is:” )
console . log ( locId );
wixData . query ( “companyNews” )
. eq ( “_id” , locId )
. find ()
. then (( results ) => {
if ( results . items . length > 0 ) {
let myitem
if ( typeof results . items [ 0 ]. photoArray !== “undefined” ) {
myitem = results . items [ 0 ]. photoArray ;
} else {
myitem = results . items [ 0 ]. mediaGallery30 // case if more than 30 pics is needed (hack for limit of 30 upload with upload button)
}
console . log ( myitem )
$w ( myGallery ). show ();
$w ( myGallery ). expand ();
$w ( myGallery ). items = myitem ;
}
})
}