Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2006
    Posts
    17

    Copy file from HDD to docs folder

    I know that I can use HTTP.Download to copy from the web and place a file into my docs folder of my program. I want to be able to do the same from a LAN. Go to a folder on my network and copy a file from that folder to my docs folder.

  2. #2
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Your best bet would be to use the File.Install() action. It will accept UNC path as source or destination and has some nice extras.
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  3. #3
    Join Date
    Mar 2006
    Posts
    17
    Here is the script I'm using with File.Install in place. It does the comparison part but when it comes to transferring the file to the docs folder its a no go.

    ListBox.DeleteItem("ListBox1", LB_ALLITEMS)
    size = File.GetSize("C:\\My Shared Folder\\full.wmv");
    exist = File.DoesExist("Autoplay\\Docs\\full.wmv");
    if exist == true then
    size2 = File.GetSize("Autoplay\\Docs\\full.wmv");
    if size ~= size2 then
    ListBox.AddItem("ListBox1", "full.wmv", "")
    StatusDlg.SetMessage("Downloading File.. Please be patient");
    StatusDlg.SetTitle("Download In Progress");
    StatusDlg.Show(MB_ICONNONE, false);
    File.Install("C:\\My Shared Folder\\full.wmv", "Autoplay\\Docs\\full.wmv", FILE_INSTALL_ALWAYS, false, false);
    StatusDlg.Hide();
    end
    end
    if exist == false then
    ListBox.AddItem("ListBox1", "full.wmv", "")
    StatusDlg.SetMessage("Downloading File.. Please be patient");
    StatusDlg.SetTitle("Download In Progress");
    StatusDlg.Show(MB_ICONNONE, false);
    File.Install("C:\\My Shared Folder\\full.wmv", "Autoplay\\Docs\\full.wmv", FILE_INSTALL_ALWAYS, false, false);
    StatusDlg.Hide();
    end

  4. #4
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Two things to try:

    1) Add an error check after the File.Install() actions. This should tell you why nothing is happening.

    Code:
    err = Application.GetLastError;
    if err ~= 0 then
    Dialog.Message("Error " .. err, _tblErrorMessages[err]);
    end
    2) I'd recommend using the full path to the network resource instead of the "C:\\My Shared Folder\\full.wmv"

    Something like:

    "\\\\MyServerName\\ShareFolderName\\full.wmv"

    or

    "\\192.168.1.101\\ShareFolderName\\fill.wmv"
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  5. #5
    Join Date
    Mar 2006
    Posts
    17
    No errors show up. But the problem isn't getting the source file it is getting the source file into the Autoplay\docs directory.

  6. #6
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    A couple things you mentioned:

    It does the comparison part but when it comes to transferring the file to the docs folder its a no go.
    and
    the problem isn't getting the source file it is getting the source file into the Autoplay\docs directory.
    How did you come to these conclusions? Does the Progress Dialog Popup?
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  7. #7
    Join Date
    Mar 2006
    Posts
    17
    Yes it is definitely a problem on the side of copying/installing the file into the Autoplay\Docs folder. If I specify the folder as being under f:\ , as is the case currently, I can get a transfer to my drive. Actually I forgot to put in my original post that this app is running on a usb flash drive and therefor the drive letter is not static. I need a way to identify the drive letter and have it automatically entered into the file.copy for the removable drive.

    This works:
    File.Copy("\\\\Guestbongo\\epubs\\E-Pubs.apz", "F:\\Autoplay\\Docs\\E-Pubs.apz", false, true, false);

    This Doesn't
    File.Copy("\\\\Guestbongo\\epubs\\E-Pubs.apz", "Autoplay\\Docs\\E-Pubs.apz", false, true, false)

  8. #8
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Try this
    Code:
    File.Copy("\\\\Guestbongo\\epubs\\E-Pubs.apz", _SourceDrive.."\\Autoplay\\Docs\\E-Pubs.apz", false, true, false)

  9. #9
    Join Date
    Mar 2006
    Posts
    17
    Thanks guys

    This is what I ended up with.


    tblDrives = Drive.Enumerate();
    sDataDrive = "";
    for n, DriveLetter in tblDrives do
    nType = Drive.GetType(DriveLetter);
    if nType == 2 then
    sDataDrive = DriveLetter;
    end
    end
    ListBox.DeleteItem("ListBox1", LB_ALLITEMS);
    folder = Folder.DoesExist("\\\\Guestbongo\\epubs3\\");
    if folder == true then
    Dialog.Message("", "Downloading Updates From LAN", MB_OK)
    size = File.GetSize("\\\\Guestbongo\\epubs3\\File compare download.zip");
    exist = File.DoesExist(sDataDrive.."\\Autoplay\\Docs\\File compare download.zip");
    if exist == true then
    size2 = File.GetSize(sDataDrive.."\\Autoplay\\Docs\\File compare download.zip");
    else if size ~= size2 then
    ListBox.AddItem("ListBox1", "Network Existed", "")
    StatusDlg.SetMessage("Downloading File.. Please be patient");
    StatusDlg.SetTitle("Download In Progress");
    StatusDlg.Show(MB_ICONNONE, false);
    File.Copy("\\\\Guestbongo\\epubs3\\File compare download.zip", sDataDrive.."\\Autoplay\\Docs\\File compare download.zip", false, true, false);
    StatusDlg.Hide();
    end
    end

Similar Threads

  1. Searching for a file and overwrite it with docs file
    By Wonderboy in forum AutoPlay Media Studio 6.0
    Replies: 32
    Last Post: 03-23-2006, 06:59 AM
  2. how copy my selected file only to my Created folder in web Object ??
    By ANAS3 in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 01-10-2006, 01:24 PM
  3. Question on DOCS folder and previous file versions
    By Larry Singer in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 03-15-2005, 01:06 PM
  4. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts