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

howto
tutorial
(Vishal) #1

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

5 Likes

Using block OnDownloadStart
Can anybody tell me how to download objects in webviewer like .png, .jpg, .mp4 format etc
(CCOO ILUNION Contact Center) #2

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

0 Likes

(SunnyTheDeveloper) #3

Have you taken a variable?

0 Likes

(Vishal) #4

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

0 Likes

(avmcreators02) #5

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

0 Likes

(Vishal) #6

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.

0 Likes

(CCOO ILUNION Contact Center) #7

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.

0 Likes

(Vishal) #8

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)

0 Likes

(CCOO ILUNION Contact Center) #9

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

0 Likes

(CCOO ILUNION Contact Center) #10

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?

0 Likes

(Vishal) #11

What have you tried so far… Show your blocks…

0 Likes

(CCOO ILUNION Contact Center) #12

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.

0 Likes

How to View Pdf File without using another app
Button click Open Google drive
(CCOO ILUNION Contact Center) #13

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

0 Likes

(Vishal) #14

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

0 Likes

(CCOO ILUNION Contact Center) #15

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

0 Likes

(Vishal) #16

call this in else part…

0 Likes

(CCOO ILUNION Contact Center) #17

Thanks as usual for your help.

beeing a wile out of theese stuf for personal reasons.

Not sure what do you mean with this.

0 Likes

(Vishal) #18

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

0 Likes