Announcement

Collapse
No announcement yet.

Download file to My Documents folder

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

  • Download file to My Documents folder

    I want to send out a numebr of CDs to my local football team community club.
    I would like to have the files download to the My Documents folder of their pcs.

    tried using this but whilst the message flashes up - the actual copying does not take place. Sure I am missing something and wonder if someone can point me please?

    Here is what I am using:

    File.Copy("AutoPlay\\Videos\\ourgoal-1.wmv", "C:\\%MyDocumentsDir%.\\", true, true, false, true, nil);
    StatusDlg.Hide();
    result = Dialog.Message("File copied", "To view this video please navigate to your My Documents folder", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

  • #2
    Thinking about this is it actually do-able - doesn't every user of a PC have the My Documents folder located at a path unique to them - for example me - c:\users\jeff\ ?

    Comment


    • #3
      Open the help file, click the Search tab, type "My Documents" (with quotes), press Enter or click the List Topics button. Study the results of the search.

      Ulrich

      Comment


      • #4
        I tried - still get even more confused

        I tried this and it failed

        -- Get the path to the user's My Documents folder.
        DestFolder = Shell.GetFolder(SHF_MYDOCUMENTS);

        -- Create a folder in the user's My Documents folder called "Copied Files".
        Folder.Create(DestFolder.."\\Copied Files");

        --Copy all files within the Docs folder in the source folder to the destination.
        StatusDlg.Show(MB_ICONNONE, false);
        File.Copy(_SourceFolder.."\\Docs\\*.*", DestFolder.."\\Copied Files\\", true, true, false, true, nil);

        -- Check to see if the File.Copy action failed by getting it's error code.
        error = Application.GetLastError();
        StatusDlg.Hide();

        -- If it failed (not equal to 0), display a dialog informing the user.
        -- If it succeeded, open an explore window showing the "Copied Files" folder.
        if error ~= 0 then
        result = Dialog.Message("Error", "There was an error copying the files to your system. Please try again.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
        else
        Shell.Execute(DestFolder.."\\Copied Files", "explore", "", "", SW_SHOWNORMAL);
        end

        Comment


        • #5
          Are you sure that you mean _SourceFolder.."\\Docs\\*.*" instead of _SourceFolder.."\\AutoPlay\\Docs\\*.*" ?

          It is hard to guess without seeing the actual project. You may want to export it and attach the *.apz here.

          Ulrich

          Comment


          • #6
            Worked it out thanks - it was a simple missing \\ to the path.
            Can I ask another - when the video file(s) download to the named folde in Documents is it possible for it to Open the file it just downloaded?

            I created 4 folders (source) which all download contents to the same folder in My Documents.

            thanks

            Comment


            • #7
              Sure, if you know the file name you wish to open, all you need to do is concatenate the new path to the file after it was copied.

              Ulrich

              Comment


              • #8
                concatenate - that is a new word for me - Im 49 - i thought I had heard everything!

                My next problem (hopefully the last) - is my Windows Media File - whilst it plays fine both within the project window and when downloaded to Documents file - is that when played directly from AM it look horrible - white of a shirt has turned pink and blue turns to burgundy!!

                Is this a codec issue?

                Comment


                • #9
                  If you are building and testing on the same computer, then it shouldn't be a codec issue. I am not sure what might be happening.

                  Ulrich

                  Comment


                  • #10
                    I have decided to try using the Windows Media Player plugin but I am struggling as to how to load the video into the object/plugin

                    tried Video.Load - also Video.Play

                    and File.Load

                    nothing seems to give me the option play the video - I am sure I am just being dumb but I am struggling . . .

                    Comment


                    • #11
                      I have also tried the Media.Player load and play - nothing gets this video to play!!

                      Arrrrrrghhhh

                      Comment


                      • #12
                        Probably using the correct format:

                        MediaPlayer.Load
                        MediaPlayer.Play

                        and reading the user manual, instead of doing random things...???
                        We are slowly invading your planet to teach lazy humans to read the user manual.
                        But don't be scared: we are here to help.

                        Comment


                        • #13
                          Here it goes hope this helps... if the video does not play at all even if you play it at windows media player launching it from file open...

                          Maybe it will be codec related look here... http://www.codecguide.com/download_mega.htm

                          Comment


                          • #14
                            MediaPlayer.Load("Plugin1", "AutoPlay\\Videos\\T4220-DIALUP\\T4220-Dial-Up-Configuration.wmv");
                            MediaPlayer.Play("Plugin1");


                            The above is what I am using - have read the manual but the file refuses to load/play - works fine playing directly from its source but nothing from within AM

                            Comment

                            Working...
                            X