1. Roel Pollet
  2. PowerBuilder
  3. Thursday, 7 January 2021 08:23 AM UTC

Hello,

On Chrome you have settings to set the download location or to always ask for this location.

But when I use the PB webbrowser control these settings are not used.

Is there a way to get these chrome settings, so I can re-use them in the PB webbrowser?

So I can set the downloadpath, the user wants?

Or is there a way to force the webbrowser to always ask where to save a file?

 

Thanks

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 8 January 2021 16:22 PM UTC
  2. PowerBuilder
  3. # 1

Am I missing something here?  Why can't you use the WebBrowserSet function to set the download path?  https://docs.appeon.com/pb2019r2/powerscript_reference/ch10s854.html

Comment
  1. Chris Pollach @Appeon
  2. Friday, 8 January 2021 17:22 PM UTC
Hi Armeen ... Duh, right on! In fact, my latest STD framework released last year does this for you auto-magically via simple INI file settings as follows:



; ----- Start Web Browser Settings Section. ----

[Browser Template]

CachePath= ; The folder that stores the web page cache, cookies etc.

UserDataPath= ; The folder that stores the user data dictionary.

DownloadPath= ; The default download path.

UserAgent= ; The User-Agent request header

ProxyAuto=1 ; Whether to use auto proxy detection( default 1=yes)

ProxyPacUrl= ; The URL of the server where the PAC file is located.

ProxyAddress= ; The address of the proxy server.

ProxyPort= ; The port of the proxy server.

ProxyUser= ; The user name that will be authenticated by the proxy server.

ProxyPassword= ; The password that will be authenticated by the proxy server.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 8 January 2021 17:31 PM UTC
PS: In the STD framework, the above INI and Web Browser code to set the WB properties is all done in the Global Function "fn_web_browser_control_settings".
  1. Helpful
  1. Roel Pollet
  2. Monday, 11 January 2021 07:52 AM UTC
Hello Armeen,



My idea was to ask the user where to save the file in in the DownloadingStart event. And then set the downloadPath. But that is too late, you can’t change the downloadPath anymore. A BeforeDownloadingStart event could be useful for this. Or a way to know the user clicked on the download button.



Otherwise I’ll try the workaround Chris mentioned earlier. "Set downloadPath to temp folder, capture the file in the DownloadingStart and move it when it’s completed.". But the problem is that there is no DownloadEnd event. Only a DownloadingStateChanged event, that fires multiple times with a value of 100%.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.