When using file upload component yo can use dataUrl parameter to get the body of the uploaded file but only when datatype is set to image. Otherwise it is set to null. What I’m trying to accomplish is to preview pdf/application type file - before it is uploaded to the server. Is it possible in Wappler ? Right now I’m uploading the file to the server - displaying it on the web page and when user cancel the process the file is being deleted from the server. This is working but requires couple more steps to accomplish.
Hello,
It’s not possible to preview PDF files like you do with images (img src and dataUrl). It’s a totally different file format, working in a totally different way.
You’ll need some custom JavaScript to do anything like this.
I know that. I just wanted to use binary data before file is send to server. Once it is on the server I have no problem with displaying it. While PDF is being more and more popular especially within “digital office” you might consider using these files the same way an image is used. Actually Bubble is displaying images nad pdfs…
It looks like Wordpress now shows a preview of the first page of a PDF when it’s uploaded so technically it’s possible. But I don’t know exactly how! Hope that helps