Trying to PutFiles to a remote site - WeOnlyDo Discussion board

Trying to PutFiles to a remote site (General questions)

by Scot Styer, Friday, April 22, 2011, 20:46 (4775 days ago)

I'm trying to do a transparent download to remote site
I'm using putfiles to download everything from the directory
to that remote site.
I'm trying to determine when it's done with all the files..
so, I can execute a disconnect
I've got the putfiles in the Done event
after clearing the connected event
It doesn't appear to be staying at the Putfiles transaction
until finished
and... it will continue to fire the done event after each file is sent
I guess what I'm trying to figure out is this...
when can I tell when the final done is being fired?
Do I need to determine how many files in the directory first?
it looks like the progress event files after each file is sent

Re: Trying to PutFiles to a remote site

by woddrazen, Friday, April 22, 2011, 23:07 (4774 days ago) @ Scot Styer

Hi Scot,


Done Even should be fired when PutFiles is finished with execution (when all files are uploaded to server).

Did you received some error maybe inside Done Event? Which version of wodFtpDLX you re using? You can check version using wodFtpDLX Version Property.


Regards,
Drazen

Re: Trying to PutFiles to a remote site

by Scot Styer, Monday, April 25, 2011, 00:13 (4772 days ago) @ woddrazen

It looks like it's only calling done once, on the putfiles
but, could it be getting called from another event
I'm connecting and executing the following
I guess I'm trying to find the best place to execute the putfiles
and the best place to execute the disconnect
I do have some message statements
in the progress, and loopitem events
the below code seems to only send 1 file

connected event
If ErrorCode <> 0 Then
messagebox('error','stop')
return
end if
p_state = 1
if p_state = 1 then
ole_1.object.putfiles( c: est2 , /sstyer ,0)
p_state = 5
end if

done event
if errorcode <> 0 then
messagebox('error','error message')
close(parent)
return
end if
if p_state = 5 then
ole_1.object.disconnect(true)
messagebox('error', 'finished')
close(parent)
return
end if
messagebox('process','done')

Hi Scot,


Done Even should be fired when PutFiles is finished with execution (when all files are uploaded to server).

Did you received some error maybe inside Done Event? Which version of wodFtpDLX you re using? You can check version using wodFtpDLX Version Property.


Regards,
Drazen

Re: Trying to PutFiles to a remote site

by woddrazen, Monday, April 25, 2011, 10:44 (4772 days ago) @ Scot Styer

Scot,


Your code looks fine. You can call PutFiles inside Connected Event. Do you received some error maybe in LoopError Event?

More help for LoopError Event you can find here:
http://www.weonlydo.com/FtpDLX/Help/wodFtpDLX-LoopError-Event.html

Let us know how it goes.


Drazen

Re: Trying to PutFiles to a remote site

by scot styer, Monday, April 25, 2011, 13:41 (4772 days ago) @ woddrazen

Actually... I am getting an error in looperror
30003 - loop error component busy
It stops after sending the first file
could it be trying to execute the disconnect before
sending all the files?

Scot,


Your code looks fine. You can call PutFiles inside Connected Event. Do you received some error maybe in LoopError Event?

More help for LoopError Event you can find here:
http://www.weonlydo.com/FtpDLX/Help/wodFtpDLX-LoopError-Event.html

Let us know how it goes.


Drazen

Re: Trying to PutFiles to a remote site

by scot styer, Monday, April 25, 2011, 14:41 (4772 days ago) @ scot styer

I even changed the code, to do a separate putfile
for each file that exists, in the directory
at the end of the loop
the Done event seems to be firing, with the error of component busy

connected event
int i
string spath, spath2
If ErrorCode <> 0 Then
messagebox('error','stop')
return
end if
p_state = 1
messagebox('error','before send')
if p_state = 1 then
for i = 1 to lb_1.totalitems()
spath = c: est2 + lb_1.text(i)
spath2 = /sstyer/ + lb_1.text(i)
messagebox('error',spath)
ole_1.object.putfile(spath,spath2)
next
p_state = 5
end if


done event
if errorcode <> 0 then
messagebox('ERROR',errortext)
close(parent)
return
end if
messagebox('error','in done')
if p_state = 5 then
messagebox('error','pstate 5')
ole_1.object.disconnect(true)
messagebox('Completed','Completed Sending')
close(parent)
return
end if

Actually... I am getting an error in looperror
30003 - loop error component busy
It stops after sending the first file
could it be trying to execute the disconnect before
sending all the files?

Scot,


Your code looks fine. You can call PutFiles inside Connected Event. Do you received some error maybe in LoopError Event?

More help for LoopError Event you can find here:
http://www.weonlydo.com/FtpDLX/Help/wodFtpDLX-LoopError-Event.html

Let us know how it goes.


Drazen

Re: Trying to PutFiles to a remote site

by woddrazen, Monday, April 25, 2011, 15:34 (4772 days ago) @ scot styer

Scot,


You are using only Connected and Done Event when you execute PutFiles Method?

What happens if you add this code inside LoopError Event
[code]ErrorCode = 0[/code]
When you execute PutFile you cannot call multiple PutFile Methods from inside Connected Event.

What you can try is to use blocking mode (Blocking Property set to True) and execute commands just after Connect Method.

In that case you should remove code from wodFtpDLX Events. In blocking mode component will go to next line only when he finished with execution of previous line.

Other option is to call PutFile inside Done Event. So when one file is uploaded (PutFile is finished) Done Event will be fired and you can execute next PutFile Method.


Drazen

Re: Trying to PutFiles to a remote site

by scot styer, Monday, April 25, 2011, 15:42 (4772 days ago) @ woddrazen

what I'd really like to do, is execute a single putfiles
but... I'm having trouble trying to determine
where I can execute my disconnect
once all the files have been sent

Scot,


You are using only Connected and Done Event when you execute PutFiles Method?

What happens if you add this code inside LoopError Event
[code]ErrorCode = 0[/code]
When you execute PutFile you cannot call multiple PutFile Methods from inside Connected Event.

What you can try is to use blocking mode (Blocking Property set to True) and execute commands just after Connect Method.

In that case you should remove code from wodFtpDLX Events. In blocking mode component will go to next line only when he finished with execution of previous line.

Other option is to call PutFile inside Done Event. So when one file is uploaded (PutFile is finished) Done Event will be fired and you can execute next PutFile Method.


Drazen