1. Christopher Craft
  2. PowerBuilder
  3. Monday, 12 June 2023 20:50 PM UTC

PB 2022 1900

I am using the WebBrowser control to display files that have been attached to our application.  If a Microsoft document (Mail, Word, Excel) cannot be displayed the control will create files in the C:\Users\chrisc\AppData\Local\Temp\pbcefdownload folder.  This seems fine but the files are not being deleted when the control or application closes.  Is there a way for this to automatically cleanup itself or do I need to cleanup that directory when the app closes.

Chris Craft

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 13 June 2023 17:13 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Chris;

   FWIW: I would suggest that your App ...

  1. Creates it's own Web Browser TEMP download folder using the CreateDirectory() command
  2. Inform the Web Browser control to use the App's Temp folder for downloads via the .... WebBrowserset ( "DownLoadPath", ls_DownLoadPath )  command.
  3. When your App completes, remove the Apps TEMP download folder using the RemoveDirectory() command.

PS: The same approach for Web Browser cached files can be used using the command  ... WebBrowserset ( "CachePath", ls_CachePath )

Food for thought.  HTH   ;-)

Regards ... Chris

 

Comment
  1. Christopher Craft
  2. Tuesday, 13 June 2023 20:01 PM UTC
Thanks Chris - I will do that.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 13 June 2023 20:54 PM UTC
Great ... please let us know how that worked out! :-)
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Tuesday, 13 June 2023 09:33 AM UTC
  2. PowerBuilder
  3. # 1

Hi Chris

In my experience it is always good to clean up as the application/wndow closes. Stuff always gets left in Temp so cleaning it yourself makes sure it's gone.

 

Hope that helps.

 

Cheers

David

Comment
  1. Christopher Craft
  2. Tuesday, 13 June 2023 20:01 PM UTC
Thanks David - I just would have thought that since the control created the files (not me) that it would have cleaned it up too. I will use Chris's suggestion above so I know which files might have been created by this control.
  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.