How to access documents being uploaded to a collection?

So I have a collection called Bulletins the collection has a column for PDFs called BulletinPDF and a column for images called BulletinJPG. I have a form where allow the user to create a new the collection. It includes picking a date then selecting a PDF and a JPG to upload. The jpg is just the same as the PDF but I need it for previewing thumbnail purposes. I want to use the convertapi node module to convert the PDF to the jpg automatically so the user only has to upload a single file and wix code will convert the rest.

This is as far as I got:


import {convertapiPackage} from ‘backend/convertapi’;
const convertapi = convertapiPackage(‘secreterasedhere’);

export function Bulletin_beforeInsert(item, context) {
item.title = (item.sunday.toString()).slice(4, 15);

//convert pdf to jpg
convertapi.convert(‘jpg’, {
File: ‘/path/to/my_file.pdf’,
JpgQuality: ‘100’
}, ‘pdf’).then( function (result) {
result.saveFiles(‘/path/to/dir’);
});
return item;


The issue is I don’t know where the file actually sits and where to export the converted image to for this to work. So I need a way to pass file-paths in if possible. Any pointers or help are appreciated.

@tenns: I have a similar problem: I can upload the documents to a collection. But now I need to know how display these documents in a page or how the user can download them. It looks that WIX gave the possibility to upload the Document with the Upload Button as you show, but is not way to use these Documents from a page?

Maybe the designers of the wix editor could try to answer these questions???