Hi!
I am super excited to finally have an option of gallery media on database (yaay!)
In my case, I need the user member to be able to add the images to a gallery (media gallery field type on database).
Is there a way to do it so the user can upload multiple images at the same time, to be uploaded to the database media gallery field?
Thank you!
Hi @ivana_machado, I have created a dynamic page which has cover photo ( filed image ) , profile photo (field image). I have created a different dynamic page where they can edit and submit these images. I have another FIELD of photos (media gallery field) , I cant use any upload button for the (media gallery field). I want my site users to Upload pictures to (media gallery field) so it can appear on the gallery of the user profile. When they will hit upload button, the image will be stored at media gallery field of the user. I have uploaded few picture manually to the gallery field, which has appeared on the user profile gallery. I need some coding so that they can upload, edit, and delete picture from the media gallery field. My website is www.nettoll.net
The picture where uploaded manually by me because i dont have a button which can connect and upload picture the (photos) filed .( Media gallery field)
Hi @ivana_machado , You have asked me to share the code for uploading images in a different post. But i guess its better to share it here.... So here is the code.... This code is unedited and u need to change it a lot according to your use case
export function uploadButton_change(event, $w) { if ($w("#gallery").items.length > 0) { if ($w("#gallery").items[0].title === "noImageUploadedImage") { let items = $w("#gallery").items; items.splice($w("#gallery").items[0], 1); $w("#gallery").items = items; } } $w("#gallery").show(); let selectedFile = $w("#uploadButton").value; let selectedFileSize = selectedFile[0].size; if (selectedFileSize < uploadedImageSizeLimit) { $w("#uploadStatusText").hide(); $w("#uploadButton").startUpload($w("#uploadButton").buttonLabel = "Uploading") .then((uploadedFile) => { let uploadfileurl = uploadedFile.url; let items = $w("#gallery").items; items.push({ "src": uploadfileurl, "description": "", "title": "" }); $w("#gallery").items = items; $w("#uploadButton").reset(); $w("#uploadButton").buttonLabel = "Upload"; $w("#imagedeletebutton").show(); if (items.length >= databaseNumberOfImages) { $w("#uploadButton").hide(); } }) .catch((uploadError) => { console.log(`Error: ${uploadError.errorCode}`); //console.log(uploadError.errorDescription); $w("#uploadButton").reset(); $w("#uploadButton").buttonLabel = "Upload"; $w("#uploadStatusText").text = "File type not supported"; $w("#uploadStatusText").show(); }); } else { $w("#uploadButton").reset(); $w("#uploadStatusText").text = " Max FIle Size : 15 Mb"; $w("#uploadStatusText").show(); } }
hey
Yes, loop at the API Docs and the samples in that for UploadButton and then you can have them upload several images and connect them to that field.