Download using Webviewer in a browser application with file name save option

this is a basic guide to download the any file with the exact filename from download URL using On Download Start block from web viewer component.

just do the exact block arrangement which is shown below.

components used -

  • WebViewer
  • Download

I hope this will help some users who wants to save file with the file name given in the download url.

i also updated the T-Browser (Open Source Version) with this download logic. if you want you can download the aia file from original post given below

6 Likes

hi, I’m trying to use your block arrangement but when I use the block set/to I can’t find global splitDownloadUrl. Don’t know if lasts actualizations did change some things or maybe I’m doing anything wrong.

Thanks in advance

Have you taken a variable?

You have to declare a global variable first with that name - splitDownloadUrl

But I’m using tokens for file downloading
Like this below

http://a.infohunts.com/files/vfm-admin/vfm-downloader.php?q=dXBsb2Fkcy9NeS1wcm9qZWN0L2FwcC1kZWJ1Zy5hcGs=&h=bb98ec71dd4ce846b4717828a2832c42&sh=ea2f1597334fe7cd253b41db6a06be69

1 Like

i think the download only works when your url have any extension in the end.
like this - http://webdomain.cmo/examplefile.apk

so the block i showed above will use http://webdomain.cmo/examplefile.apk as a download link and it will split from last / and use examplefile.apk as a file name.

however if this method doesn’t work then use chrome custom tabs or another web viewer with open link as external enabled so it will open a browser to download your file.

Done and working. Thanks for your time.

Just in case of, Is there any way that the file doesn’t start downloading directly but open in webviewr or external browser, so the user can chose betwenn read it or download it?

An example link could be this one:
https://www.ccoo-servicios.es/archivos/telemarketing/Convenio-Contact-DEF.pdf

Thanks again for all your help, people.

1 Like

you can give an option to users like Read or Download,

if a particular file extension detected in the download URL, (in your case PDF)

Not sure how could I do that, but I’LL investigate it, thanks.

Hi, I’m triying to figure how to do it for a few days but dont find the way.
Could you give me any clue?

What have you tried so far… Show your blocks…

Well, I´ve just have find some kind of solution.

If i Upload the pdf docs to my google drive, not to my web server, the links obtined in the sharing by a link option of Drive, works perfectly with Web Viewer component, opening the Drive pdf file preview and letting the user chose to read or download that document.

thanks you all for the support.

In the kind of solution that I found there is a trouble. When I press the Download button In the Google Drive Preview that opens inside WebViewer, the archive downloads with the Google Drive Share link (long and without extension) so is not a perfect solution.

Hi again, this is exactly what I´m triying to do now. I want that If and only in some link is detected the extension .pdf this links opens in external browser, but rest of links (without extendion .pdf) opens in WebViewer

But the onli thing I have finded in the web is something like that.

But It´s not working

use “url” option provided by download start block instead of webviewer1.CurrentURL
check if that works or not

Thanks for your help

I Assume that you mean something like this:

Well, It works partially.

When I press a link that contains .pdf extension It opens in an external browser.

But

When I go back to main page and press any other link (that doesn´t contain .pdf) it also opens in an external browser.

Is something like the order “open in an external browser” keeps in memory

call this in else part…

Thanks as usual for your help.

beeing a wile out of theese stuf for personal reasons.

Not sure what do you mean with this.

I’ll make a block and share here after I return from my vacation… If possible ping me after few days,

Help. How to make or find this block?

use web viewer component… i haven’t checked it but i think the blocks are there