1. mathews rutto
  2. PowerBuilder
  3. Monday, 22 January 2024 07:29 AM UTC

Hi,

How do i copy/cut a document from one folder to folder location via a shared folder network.

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Monday, 19 February 2024 08:02 AM UTC
  2. PowerBuilder
  3. # Permalink
That is terrific news, Matthews! Would you please take a moment and mark your question/issue as resolved? Thank you.
Comment
There are no comments made yet.
mathews rutto Accepted Answer Pending Moderation
  1. Thursday, 22 February 2024 11:08 AM UTC
  2. PowerBuilder
  3. # 1

Hi sorry to come back again.

How do i check if it has copied the file successful FileCopy ("\\serv\vol1\folder\file.txt", "\\serv\vol2\folder\file.txt")

Comment
  1. Andreas Mykonios
  2. Thursday, 22 February 2024 13:32 PM UTC
Hi.

The easiest way I can think is to calculate a hash for it's content (one for the source and one for the destination). If both hash match you should be ok.

Andreas.
  1. Helpful
  1. mathews rutto
  2. Thursday, 22 February 2024 13:35 PM UTC
Will you mind if you can give a sample of how to calculate a hash?
  1. Helpful
  1. René Ullrich
  2. Thursday, 22 February 2024 14:36 PM UTC
Read the file in a blob and use the MD5 function of crypterobject to get the hash as a blob. You can convert the hash to a hex string using the HexEncode function. You can find an example in the onlinehlp for MD5 function.
  1. Helpful 1
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 19 February 2024 08:02 AM UTC
  2. PowerBuilder
  3. # 2
That is terrific news, Matthews! Would you please take a moment and mark your question/issue as resolved? Thank you.
Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 15 February 2024 09:25 AM UTC
  2. PowerBuilder
  3. # 3

Hi.

If you simply code the doubleclicked event of a listbox like:

if index > 0 then
	messagebox("", text(index))
end if

a messagebox will show you the filename you doubleclicked on.

Andreas.

Comment
  1. mathews rutto
  2. Friday, 16 February 2024 04:49 AM UTC
How do i loop the listbox, i want to picked the name then store into database.
  1. Helpful
  1. John Fauss
  2. Friday, 16 February 2024 05:08 AM UTC
Check out: https://docs.appeon.com/pb2022r3/objects_and_controls/ListBox_control.html

UpperBound(listbox_1.Item[]) will tell you the number of items in the listbox control named listbox_1. listbox_1.Item[1] will be the first item in the listbox, listbox_1.Item[2] will be the second item, etc.
  1. Helpful 1
  1. mathews rutto
  2. Monday, 19 February 2024 05:12 AM UTC
Thank you. i am helped.
  1. Helpful
There are no comments made yet.
mathews rutto Accepted Answer Pending Moderation
  1. Thursday, 15 February 2024 06:28 AM UTC
  2. PowerBuilder
  3. # 4

In addition to this,

is there a way i can see all documents from a folder in powerbuilder.

My objective is to pick a document from a list of documents in folder then copy to another location.

Comment
  1. René Ullrich
  2. Thursday, 15 February 2024 06:51 AM UTC
The easiest way is to use the GetFileOpenName function. It opens a standard file open dialog to select one or more file(s).

If you want to write your own dialog you can use the DirList function of listbox control.
  1. Helpful 1
  1. mathews rutto
  2. Thursday, 15 February 2024 08:08 AM UTC
This is Helpful and i am grateful.
  1. Helpful
  1. mathews rutto
  2. Thursday, 15 February 2024 08:09 AM UTC
How do i doubleclick the listbox to get specific file?
  1. Helpful
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Monday, 22 January 2024 08:01 AM UTC
  2. PowerBuilder
  3. # 5

You can use FileCopy and FileMove functions also with shared folder network.

Comment
  1. René Ullrich
  2. Monday, 22 January 2024 08:15 AM UTC
I successfully tested it with files on network shared. I used UNC paths.

example: FileCopy ("\\serv\vol1\folder\file.txt", "\\serv\vol2\folder\file.txt")
  1. Helpful
  1. mathews rutto
  2. Monday, 22 January 2024 08:51 AM UTC
This means i have to save the credentials to the shared folder
  1. Helpful
  1. mathews rutto
  2. Thursday, 15 February 2024 06:25 AM UTC
Thank you
  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.