1. Samuel Sanchez Avila
  2. PowerBuilder
  3. Monday, 11 October 2021 16:06 PM UTC

Hello, 

 

At the wb object, there are a few visual options, such as print, download.

Does any one knows how-to download documents? I'm loading pdfs with wb_1.navigate(ls_path_doc)

 

I have notice that the event for download is DownloadingStart, but im having doubts with functions...

 

Thanks.

Accepted Answer
Marco Meoni Accepted Answer Pending Moderation
  1. Monday, 11 October 2021 18:09 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Samuel,

Im not sure I understood whether you want to download a file from a Web URL or not?

You can use HttpClient object and store the web file into a blob with GetResponseBody()

https://docs.appeon.com/pb2017r2/powerscript_reference/ch10s238.html

Best,

.m

 

Comment
  1. Samuel Sanchez Avila
  2. Monday, 11 October 2021 22:07 PM UTC
noo, im loading a file with this form wb_1.navigate("C:\example\test.pdf"). it shows two icons, to download and print, im asking for download option, to download the pdf file that i just loaded
  1. Helpful
  1. Marco Meoni
  2. Tuesday, 12 October 2021 05:17 AM UTC
oh, I see. Then, you must first use e.g. WebBrowserSet('DownloadPath', 'C:\temp'), and you will find the downloaded file there.

Best,

.m
  1. Helpful 1
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 11 October 2021 18:42 PM UTC
  2. PowerBuilder
  3. # 1

Is this for the built-in Web Browser control?

Comment
  1. Samuel Sanchez Avila
  2. Monday, 11 October 2021 22:06 PM UTC
Yes. If i Load a pdf file in a web browser. wb_1.navigate("C:\example\test.pdf") it shows two icons, to download and print, im asking for download option, to download the pdf file that i just loaded

  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 12 October 2021 01:14 AM UTC
  2. PowerBuilder
  3. # 2

Hi Samuel,

When clicking the ‘Download’ button, the pdf file will be downloaded automatically. It will trigger the downloadingstart and downloadingstatechanged event. The filename argument in downloadingstart will return the full file path of the downloaded file, for example:
C:\Users\Appeon\AppData\Local\Temp\pbcefdownload\datawindow.pdf

You can use WebBrowserSet/WebBrowserGet to set/get the download path.

Regards,
ZhaoKai

Comment
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.