Drag files and upload it

Josep jmyepes at mac.com
Tue Jul 28 15:01:24 EDT 2009


Hi List,

Today's problem is: a)The user drag one file into one stack. The program
must get the file, b)copy to a local folder and c)upload it to a server
folder. The files can be of any type. If the file is a image these must be
d)showed scaled into a image control.

Step a) is OK
Step b) is OK if I drag from the desktop or local folders, if I drag from
the webpage the file is 0Kb size.
Step c) is OK if I drag from the desktop or local folders, if I drag from
the webpage the file is 0Kb size
Step d) is OK both from the desktop or web page.

Code from image "img_card" DragDrop:
----------

on dragDrop
   
   lock screen
   -- Change it to the original size. In many cases the droped image is very
small and difficult to point
   set the width of me to 210
   set the height of me to 295
   
   -- In the case of multiple files to be copied
   repeat for each line tFile in the dragdata
      --xxxx
   end repeat
   -- 
   
   set itemdel to "/"
   put the last item of the dragdata into fld lbl_filename
   put the last item of the dragdata into tFileName
   
   set the fileName of me to the dragData -- Show the image into the image
control
   
   put url ("binfile:" & the dragdata) into URL ("binfile:" & tFileName) --
Guarda archivo en directorio local si el origen es local
   
   --put url ("binfile:" & the dragdata) into tFileName -- Carga el fichero
en la variable para ser subida al servidor FTP
   put url ("binfile:" & tFileName) into tFileName
   
   set the visible of  button b_scroll to true

-- Callback messages init and upload to the server
   libURLSetStatusCallback "myStatus",the long ID of me
   libURLftpUpload
tFileName,"ftp://www.ledr-ingenieria.com:xxx@www.ingenieria.com/ca/"& fld
lbl_filename,"OK"
  
   -- Scale the image
   put ScaleObject( the formattedwidth of me,the formattedheight of me,the
width of me,the height of me) into myNewSize
   set itemdel to comma
   set the width of me to item 1 of myNewSize 
   set the height of me to item 2 of myNewSize 
   unlock screen
end dragDrop


Any tip are wellcome :)

Salut,
Josep
-- 
View this message in context: http://www.nabble.com/Drag-files-and-upload-it-tp24705887p24705887.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list