FOLDER via FTP

Paolo Mazza mazzapaolo at libero.it
Tue Dec 30 12:20:44 CST 2003


Here it is the script to transfer a folder via FTP. It works.  any 
suggestion to increase security?
I wish you an happy new year.
Ciao Paolo


LOCAL tUrl,tUrl2,LISTAFILES,KK,NOMECARTELLAREMOTO

on MouseUP
   if the opensockets is not empty then resetAll
   put field "MioFile" of this card into NOMECARTELLA
   if there is not folder NOMECARTELLA then exit to top
   set itemdelimiter to "/"
   put the last item of NOMECARTELLA into NOMECORTO
   set itemdelimiter to comma
   put "Desideri trasferite tutta la cartella" && NOMECORTO into DOMANDA
   answer  DOMANDA with "OK" or "ANNULLA"
   if it is "OK" then
     put field "MyUsername" of first card  into NOME
     put field "MyPas" of first card  into PAS
     put field "MyHost"  of first card into NOMEHOST
     put "ftp://" &  NOME & ":" & PAS   & "@"  & NOMEHOST & "/" into tUrl

     put empty into LISTAFILES
     set the defaultfolder to NOMECARTELLA
     put the files  into LISTAFILESTEM
     repeat for each line LINEA in LISTAFILESTEM
       if char 1 of LINEA is "." then next repeat
       put LINEA & return after LISTAFILES
     end repeat

     ask "Nome della nuova cartella" with NOMECORTO
     put it into NOMECARTNUOVO
     CARICACARTELLA NOMECARTNUOVO
   end if
end MouseUP

On CARICACARTELLA NOMECORTO
   libURLSetFTPStopTime 30
   set itemdelimiter to "/"
   put field "cardes"  & "/" & NOMECORTO into NOMECARTELLAREMOTO
   put NOMECARTELLAREMOTO & "/.fantasma.txt" into NOMEFILEREMOTO
   put tUrl  &  NOMEFILEREMOTO  into  tUrl2
   put empty into tData
   libURLftpUpload tData,tUrl2,FINITO
end CARICACARTELLA

on FINITO then
    put tUrl2 & return into message
   -- delete URL tUrl2
   put 1 into KK
   put line KK of LISTAFILES into LINEA
   if there is file LINEA then
     CARICADATI LINEA
   else
     exit to top
   end if
end FINITO

On CARICADATI NOMEFILE
   set itemdelimiter to "/"
   put last item of NOMEFILE into NOMECORTO
   if the hilited of button "dati" is true then
     put "binfile:" & NOMEFILE into NOMEURL
   else
     put "file:" & NOMEFILE into NOMEURL
   end if

   put tUrl & NOMECARTELLAREMOTO & "/" & NOMECORTO into tUrl3
   put url NOMEURL into tData
   put tUrl3 & return after message
   libURLftpUpload tData,tUrl3,FINITO2
   -- FINITO2

end CARICADATI

on FINITO2 then
   -- if the opensockets is not empty then resetAll

   put empty into LINEA
   if KK >= (the number of lines of LISTAFILES) then
     answer "Caricamento effettuato" with "OK"
     exit to top
   end if
   put KK + 1 into KK
   put line KK of LISTAFILES into LINEA
   if LINEA is not empty and there is file LINEA then
     CARICADATI LINEA
   else
     answer "Errore nella trasmissione del file" with "OK"
     exit to top
   end if
end FINITO2



Lunedì, 29 Dic 2003, alle 12:06 Europe/Rome, Paolo Mazza ha scritto:

> How can I send a folder via FTP to a FTP server?
>
> I know how can I send a file via FTP, but I found no hints on the doc 
> about sending  ( or creating)  a folder.
>
> Best regards,
>
> Paolo Mazza
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list