Download open option

Questions and comments about currently under development PWB v3

Moderators: Tyler, Scott

pschneider
Observer
Observer
Posts: 3
Joined: Tue Nov 11, 2014 8:59 pm

Download open option

Post by pschneider »

Hi,

Was wondering if there is a way to enable a file to be opened when clicking on a link that starts a download?

Currently it asks for a location for the file to be saved, the machines we currently use are heavily locked down, and the files that are being downloaded need to be opened straight away anyway. So instead of asking, it just downloads it, and opens the file automatically.

Or am I missing something in the config that might do this already?

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

Unless the application that opens the file type has an ActiveX control that opens in Internet Explorer, the files need to be downloaded to open.

It may be possible to use a custom download manager with IE and thus PWB to accomplish what you want to do.

https://code.msdn.microsoft.com/windows ... r-8ab5d910

--Scott

pschneider
Observer
Observer
Posts: 3
Joined: Tue Nov 11, 2014 8:59 pm

Re: Download open option

Post by pschneider »

Sorry, I should have stated that I am using the Chrome version.

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

The Chrome version presents some challenges as it is not as mature as IE API the IE version uses.

I can add a Download Manager to our to do list.

Do you have an example URL with a file download we could take a look at?

--Scott

pschneider
Observer
Observer
Posts: 3
Joined: Tue Nov 11, 2014 8:59 pm

Re: Download open option

Post by pschneider »

I can do that, is there an email I can use to send some login details?

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

Support at teamsoftwaresolutions.com

--Scott

ProBiblio
Observer
Observer
Posts: 4
Joined: Mon Dec 28, 2015 1:15 pm

Re: Download open option

Post by ProBiblio »

Hi guys,
I have a similar challenge.
I have PWB 3 installed with Chrome on Windows 10, and managed to tweak the system so that PWB opens the .PDF file when selected from the Windows Explorer.
Howerever, opened from a site it wants to just download the file.
I would like to see that the file is indeed (temporarily) downloaded to the download directory stated in the INI file, but than opens the file on a new tab.
A sample URL is http://www.probiblio.nl/index.php?cmd=f ... &file=4125
This downloads a PDF that needs to be opened in a new tab.
It would be awesome if we can get this to work.

Sincerely,
André Backs

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

The link referenced is forcing downloading the PDF file. It does the same thing in Chrome.

Are you looking for a way to prevent the site from forcing the download?

--Scott

ProBiblio
Observer
Observer
Posts: 4
Joined: Mon Dec 28, 2015 1:15 pm

Re: Download open option

Post by ProBiblio »

Hi Scott,
no not directly. The download itself is OK but the file needs to be opened after download.
One option could be that te file is downloaded to a temporary location (e.g. %temp%) and then openened. To be deleted when the program ends.
An additional problem is that upon opening the link you get a "save as" file-open dialog from where you can do most anything you like as in Windows Explorer.

To explain, I wrote a alternative user shell environment that opens when the PC starts. From there the user can start PWB via menu buttons tied to a prescribed URL.
I am looking in to a solution where a download can be stored in a fixed location (as is the option in PWB.INI) and monitor that folder.
If anything appears in the folder a list would appear in the shell and the user can open these files (PDF) with PWB, or print or delete them.
(I'm not quite sure yet about the user interface on that)

So, if PWB could quietly store the file downloaded from the link I would be done for 80%

André

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

The following settings are suppose to do something similar this type of functionality.

[Directories]
SaveAsDirectory=
SaveAsErrorTitle=Floppy required
DownloadDirectory=
DownloadErrorTitle=Floppy required


However we could force all PDF downloads to download to the cache then ShellExecute to open the file in the default application.

Or we could add a filter that checks the file type before downloading and if it matches save the file to the cache then ShellExecute to the file which would open it in the default application.

Or we could add a filter that when matched would download the file then run a script with the file path in the command line.

Not sure which would be the best option. We are open for suggestions.

--Scott

ProBiblio
Observer
Observer
Posts: 4
Joined: Mon Dec 28, 2015 1:15 pm

Re: Download open option

Post by ProBiblio »

Happy New Year ! :D

maybe if we do it like this:
add an entry per file extension (e.g. PDF=[parameters])
if no parameter is given after then extension (i.e. PDF= ) then launch the file using shell extension / mime-type application
if a parameter is given (i.e. PDF=c:\pwb\pwb.exe or PDF=c:\script\scipt.vbs) launch then file with the given script
if given parameter is - or 0 (e.g. PDF=- or PDF=0) never launch the file
so
PDF=c:\pwb\pwb.exe would launch the PDF file with PWB
PDF=0 would never launch the file
PDF= would launch the PDF with the system default

Of course, the files downloaded in this fassion need to be deleted after we leave the PWB program

André

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

Starting with PWB v3.04.5 this version includes an "execute" filter for files that are downloaded.

[Files]
ExecuteFilterFile=execute.txt

[Security]
CheckExecuteAccess=True

The filter works similar to the other PWB filters. When the filter is enabled, before a file is downloaded the mime type is checked against the filter and either downloaded, canceled, or opened via ShellExecute. The tokens for the filter are as follows.

"+" = Download file.
"-" = Disable download file.
"!" = Open file in associated application.
"#" = Navigate to file in PWB.
"=" = Ignore file, cancels download no message.

Enabling Access Logging ([Security]LogAccess=True) and the History file will help identify the type of mime file reported by the web site when the file forced to be downloaded.

Here is an example of a execute filter file.

-all
!application/pdf
+application/msword
=application/zip
!application/octet-stream

The above filter file disables all downloads, opens PDF files and generic Octet-Streams in their respective applications, downloads Word files, and ignores ZIP files.

If the file is opened, it is first saved to the cache folder then opened. If clear cache on close is enabled the files will be removed.

--Scott

ProBiblio
Observer
Observer
Posts: 4
Joined: Mon Dec 28, 2015 1:15 pm

Re: Download open option

Post by ProBiblio »

Hi Scott,
Works like a charm.
There is however one small problem :mrgreen:
If you set PWB as the default APP to open PDF's download an opening a PDF ends up in an infinite loop of empty pages (and they open in a new instance, not a tab)
And the PDF is downloaded again and again and again...
SchoolWise instellen - Barcodefonts installeren[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1].pdf
SchoolWise instellen - Barcodefonts installeren[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1].pdf
SchoolWise instellen - Barcodefonts installeren[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1].pdf
SchoolWise instellen - Barcodefonts installeren[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1].pdf

Just a detail :)

And I would like to use PWB as a PDF viewer.

Cheers,

André

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

Try setting the following in your INI file.

[Security]
DisableSecondInstance=True

--Scott

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: Download open option

Post by Scott »

With PWB 3.04.5 CEF L we added the following filter option.

"#" = Navigate to file in PWB.

Using this option in the filter will open the file in PWB after downloading it.

--Scott

Post Reply