I want user upload a photo then i connect cms dataset to galery viewer. I want to see user uploaded photo will be seen in galery but uploaded photos are in only visitor uploads file. I want “user can see in galery in a few seconds” time is not important.
Briefly explain what’s not working or where you’re stuck
Working in
CMS / DATASET / MEDIA GALERY / VISITOR UPLOAD FILES
What I’m trying to do
User 1 upload a photo, then this photo will be uploaded on cms dataset1 for example. i added media gallery column into collection. So then i connect this collection gallery to normally gallery in page. So when user upload photo1 then photo1 will be seen in gallery which is on the page.
Extra context
Connections cms and submit datasets are okay, user uploaded photos are in wix media uploads in visitor uploads. but want this photo will be upload on gallery in user page
USER CAN UPLOAD PHOTO as you see visitorupload1 named photo
BUT NOT SYNC with CMS named photo. i want user upload photo then photo will bee seen on cms photo gallery
What gets stored in the collection isn’t the actual image data, but rather the reference URL to the image. The image itself is uploaded to your Media Manager, and when you upload it, you should also obtain its reference URL and save it in the collection that stores data for the gallery. The gallery should then be able to retrieve the image reference URL from the collection and display the image accordingly!
I dont understand. This situation is not about url. Simple i guess. User upload a photo, user need to see in gallery which is on user interface. Data is only photo not pdf etc.
Can you give more detailed code or way? Or example? Sentence is not detailed so i could not apply your advice
Hi. I’m not sure exactly what steps you’re following to upload images, but when you upload one, you’ll need to retrieve its URL and save that to your gallery’s CMS. The reason is that image data itself is not stored directly in the collection. It may look like the image is saved there, but in reality, only the URL is stored while the actual file resides on Wix’s servers.
Since image files are usually several megabytes or more, they generally aren’t stored directly in databases. While it’s technically possible to convert an image into base64 text and store it in the collection as plain text, that goes against the intended purpose of a database. Each field in a Wix collection is limited to 500KB, so it’s clear that most image data cannot actually fit there. Instead, what gets stored is the URL pointing to the real location of the image.
There should be a basic upload scenario using an Upload Button described here, so I recommend starting with that as a reference.
$w("#myUploadButton")
.uploadFiles()
.then((uploadedFiles) => {
uploadedFiles.forEach((uploadedFile) => {
console.log("File url:", uploadedFile.fileUrl); // this is it!!
});
})
.catch((uploadError) => {
let errCode = uploadError.errorCode; // 7751
let errDesc = uploadError.errorDescription; // "Error description"
});
can i reach you on instagram or whatsapp? i could not really understand because my buttons not includes velo code. Just collection and buttons. then i want to see in galery which is on page
okay you send how to uploaded files url getting. i see but then? What will i do for finalize my requests..