Announcement

Collapse
No announcement yet.

Copying the result from Files Browser to Variable distination

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copying the result from Files Browser to Variable distination

    Hi

    I know it seems so easy to be done, but i tried my best but didn't find how to do it.

    I want to make a file browser where the users will browse their own files that will copied to a variable destination (depending on a certain inputs values ).

    I found an example in the help file which makes a ZIP file from the selected files, the process is the same which i need but not zipping the files, i only need them to be copied to the variable destination.

    Regards

  • #2
    Hi you could try this example and adjust code to suit your needs
    File_FolderCopyWithProgress.apz
    Cheers

    Comment


    • #3
      This is amazing , I learned a lot from your example, but there are two problems :
      1- You made the example to copy with no multiple selection and when i changed the code to accept multiple selection it still only copy the first file i choose.
      2- The Gif plugin is very important and i dont have it, i hope it still exist and free

      Regards

      Comment


      • #4
        Hi Sameer
        I don't want to do everything for you - RTFM on file browse ,then check the code eg:
        Code:
        tb = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat",[COLOR=#FF0000][B]false[/B],[/COLOR] true);
        if (tb ~= nil) then
        Click image for larger version

Name:	files.png
Views:	163
Size:	13.8 KB
ID:	299984
        The best way to learn is by using the manual and trying to understand the code in examples given

        OK I have added gif plugin (free lic) - unzip to Objects plugins - [ATTACH]n299985[/ATTACH]



        Attached Files

        Comment


        • #5
          Dear Colc

          First I appreciate your help so much and i thank you for your precious time that you gave us to answer our silly and easy questions.

          Second, i don't want you to do everything for me , i tried my best to do it, and i searched the TFM and i tried the examples before i posted my question, and i even spend days trying to figure how to do things before i asked members here to help.

          Third , if you read my reply you will find that i changed the code to Allow multiple selection, and also searched again in TFM but it didnt work, it still copy only one file which is the first one you choose.

          Finally, you are giving a great help, and i have been benefit a lot from your answers to all members.
          Hope you continue helping us with our silly Questions until we become an experts

          Regards

          Comment


          • #6
            Hi my apologies,I jumped the gun not reading your post correctly
            We have to build a table of files to copy if you want multiple files
            Did you get the GIF plug? I'll try another example soon

            Comment


            • #7
              No need to apologies you are helping more than you think.

              I'll try figure how to build a table of files from browsed files until u post your solution

              I got the GIF plug but didn't find how to put my own GIF images

              Thank you again Mr. Bean

              Regards

              Comment


              • #8
                Hi again try these
                Files_CopyWithProgress.apz
                GIF_SampleV8.apz
                Cheers

                Comment


                • #9
                  Thank you so much ,

                  Everything is working now , and i made my changes to the CODE .

                  Seriously i learned a lot from this example.

                  Regards

                  Comment


                  • #10
                    Here's a simpler way of doing multiple File.Copy (see attachment) using a custom callback function with the Progress-Object to graphically display copy progress. Uses less code, so is a little leaner / cleaner. (No plugins required).

                    Or you could go even simpler, using just the built-in Status Dialog to display the copy progress. (No callback function required). Like this:

                    Code:
                    -- create a table of file/s to copy
                    tFiles = Dialog.FileBrowse(true, "Select Files", _SourceDrive, "All Files (*.*)|*.*|", "", "dat", true, false);
                    
                    -- choose destination for files to be copied to
                    if tFiles[1] ~= "CANCEL" then
                        sDest = Dialog.FolderBrowse("Select 'Save-to' Destination:", _DesktopFolder); 
                            
                        if sDest ~= "CANCEL" then
                        
                            -- use the built-in status dialog to display copy progress
                            StatusDlg.Show(MB_ICONINFORMATION, false);
                            StatusDlg.ShowCancelButton(true, "Cancel");    
                            
                            -- create a 'for' loop to iterate over table of files to copy
                            for key, value in pairs (tFiles) do        
                                File.Copy(value, sDest, true, false, false, true, nil);
                            end        
                            -- hide the status dialog
                            StatusDlg.Hide();        
                        end
                    end
                    Attached Files

                    Comment


                    • #11
                      Hi Bio,
                      Excellent work as usual
                      Cheers

                      Comment


                      • #12
                        Modification Update:
                        • Integrated a Cancel_Copy function to give user option to abort copy in progress..
                        • Callback function moved over into Globals.
                        Nb.
                        G'day, colc.
                        Attached Files

                        Comment


                        • #13
                          LOL
                          I was gonna tell you that it needs a cancel Button , but i thought its enough asking thing for this topic .

                          Thank you Both (colc, BioHazard) for you great help.

                          Comment


                          • #14
                            @sameer
                            You might find this thread of some relevance: HERE

                            Comment

                            Working...
                            X
                            😀
                            🥰
                            🤢
                            😎
                            😡
                            👍
                            👎