I've been working with the Dropbox module in order to integrate a few functions into a dashboard page on my site. I've successfully gotten it to list files in a folder, but I'm not able to upload files. The difficulty comes when I try to pass a file object to the back-end.
First, to get the file object, I'm using HTML messaging since it doesn't seem to be natively supported in WiX for some reason (if there's an easier way, please let me know). For this implementation, I have an HTML element with a file input button. The site page has a button which sends a message to the HTML element when clicked. When the HTML element receives the message, it responds with the uploaded file. Upon receiving the response, the site page then calls the Dropbox upload function from the back-end, passing the file along. It should be noted that
console.log('Front-end: ' + MY_FILE)
correctly returns 'Front-end: [object File]' at this point.
The problem now is that the back-end does not receive the same object. If the first line of my Dropbox upload function is
console.log('Back-end: ' + MY_FILE)
I instead get the output 'Back-end: [object Object]'. As a result, any files uploaded to my Dropbox from the rest of the function are simple 15-byte files containing the string '[object Object]'.
I've been able to get this to work in Preview mode by putting the Dropbox commands in my front-end rather than the back-end, and everything went smoothly, so I don't think it's the implementation of the Dropbox API. However, that approach doesn't work on a published website. As far as I can tell, it seems to be a problem with file objects in Wix. I know that WiX does not support hosting files, but I'm not looking for it to do so. All I'm looking for is that it's able to pass on these objects. Is there some package to import that would allow WiX to handle these properly in the back-end?
Thanks in advance!