Muchas Gracias...lo hice de esta forma: (Creditos Dipro)Dow Sher escribió: ↑10 Jun 2020 04:30Puedes hacer una conexión por FTP y dejar al descubierto por la falta de seguridad de AMS las credenciales de tu servidor, o en tu servidor montas un backend para preparar recibir archivos por https, por ejemplo, puedes hacer con PHP que AMS por HTTP.Submit le envíe un archivo y PHP se encargue del guardado, pero también debes limitar esas cosas ya que al ser web está al alcance de todos. Depende de lo que quieras hacer y cómo lo quieras hacer.
host = Label.GetText("LBL_LOCALHOST");
directory = Label.GetText("LBL_ARCHIVO");
username = Label.GetText("LBL_USUARIO");
password = Label.GetText("LBL_CONTRASENA");
if (host ~= "") and (directory ~= "") and (username ~= "") and (password ~= "") then
-- Set the variable 'Folder' to the path to the folder chosen by the user
Folder = Dialog.FolderBrowse("Please select a folder:", _DesktopFolder);
-- Continue only if a folder was selected!
if (Folder ~= "CANCEL") then
-- Set the variable 'Files' to hold all of the files' paths
Files = File.Find(Folder, "*.pdf", true, true, nil);
-- Set the variable 'file_count' to hold the file count of the folder chosen
file_count = Table.Count(Files);
-- Continue if there are files in the folder
if (Files ~= -1) then
-- Connect, change to the proper diectory and
-- if needed make the folder needed
FTP.Connect(host, username, password, "", true);
ERRORCHECKING();
-- Make the user specified directory if it
-- does not exist already
FTP.MakeDir(directory);
FTP.ChangeDir(directory);
ERRORCHECKING();
-- For each file in the chosen folder
-- first update the 'Status Dialog' box
-- then, upload each file in the chosen
-- folder
StatusDlg.SetMeterRange(0, file_count);
StatusDlg.Show(MB_ICONINFORMATION, false);
StatusDlg.SetTitle("FTP Upload Status . . .");
StatusDlg.SetMessage("FTP Upload in progress . . .");
StatusDlg.ShowCancelButton(true, "Cancel");
cancelled = StatusDlg.IsCancelled();
for n=1,file_count do
StatusDlg.SetMeterPos(n);
StatusDlg.SetStatusText(n.." of "..file_count);
FTP.Upload(Files[n], n..".pdf", nil);
StatusDlg.SetMeterPos(n);
end
Label.SetVisible("LBL_EXITO", true)
Image.SetVisible("IMG_SUBIDA", true)
StatusDlg.Hide();
FTP.Disconnect();
end
end
else
Dialog.Message("Notice!", "You must enter data in all of the fields!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end