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.
Professional Software Development Tools
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.
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)))))))==============================================
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
Two things to try:
1) Add an error check after the File.Install() actions. This should tell you why nothing is happening.
2) I'd recommend using the full path to the network resource instead of the "C:\\My Shared Folder\\full.wmv"Code:err = Application.GetLastError; if err ~= 0 thenDialog.Message("Error " .. err, _tblErrorMessages[err]);end
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)))))))==============================================
No errors show up. But the problem isn't getting the source file it is getting the source file into the Autoplay\docs directory.
A couple things you mentioned:
andIt does the comparison part but when it comes to transferring the file to the docs folder its a no go.
How did you come to these conclusions? Does the Progress Dialog Popup?the problem isn't getting the source file it is getting the source file into the Autoplay\docs directory.
Yeah right. Who's the only one here who knows the illegal ninja moves from the government?
()))))))))o)))))))==============================================
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)
Try this
Code:File.Copy("\\\\Guestbongo\\epubs\\E-Pubs.apz", _SourceDrive.."\\Autoplay\\Docs\\E-Pubs.apz", false, true, false)
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