multiple upload, only 1 file uploaded ? - WeOnlyDo Discussion board

multiple upload, only 1 file uploaded ? (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Arrow, Thursday, June 02, 2005, 21:56 (7113 days ago)

Hi,

Trying out the demo and i've found everything works fine
so far except if i do multiple uploads. i have blocking mode
enabled...i'm doing like this:

sFromLocalDir = c: mp

bFirst = True
While Util_GetNextFilename(sFromLocalDir, , sFilename, bFirst) <>
m_Sftp.SendFile sFromLocalDir & sFilename
bFirst = False
' DoEvents 'don't think i need this
Wend

..this will iterate through my local dir and send up to the sftp
server. SendFile is just an internal wrapper class around PutFile,
..what happens is that the 1st file is sent with no problems, but after that, no more files are sent(?)...there are no errors (i have a
catch in my SendFile function, Err.Number = 0 )...stepping through
the debugger all files are valid, etc.

..any idea what's wrong ? ..thanks

Re: multiple upload, only 1 file uploaded ?

by Arrow, Thursday, June 02, 2005, 21:59 (7113 days ago) @ Arrow

...just noticed...posting to this forum removes backslashes

from my previous post:
sFromLocalDir = c:tmp

..there is a backslash after the ':' and after the 'p'

Re: multiple upload, only 1 file uploaded ?

by wodSupport, Thursday, June 02, 2005, 22:00 (7113 days ago) @ Arrow

Arrow,

use doble slash in posts to get single slash :)

Anyway about your problem - did you try setting sftp.Blocking = true?

Re: multiple upload, only 1 file uploaded ?

by Arrow, Thursday, June 02, 2005, 22:27 (7113 days ago) @ wodSupport

did you try setting sftp.Blocking = true?

yes it is (i mentioned it was enabled in my 1st post)

...anyway, i found the problem ...it appears to be
a bug in component :P As mentioned i set the remote dir with
a call to RemotePath 1st...then i iterate through my local files
and call PutFile, specifying only the local dir/file ...it
should use my RemotePath correct ? ...but it only works for the
first one ...i found to make it work, i explicitly have to
add the remote path parameter to the PutFile method everytime ...the
other weird thing that threw me was that i log after every PutFile
and my log calls RemotePath, it was showing the correct path
everytime, even though it wasn't putting the file there.

Re: multiple upload, only 1 file uploaded ?

by wodSupport, Thursday, June 02, 2005, 22:31 (7113 days ago) @ Arrow

Arrow,

oh, I don't think this is a bug. RemotePath holds full path (may include filename) where file will be saved. Component may overwrite it internally if needed. If you didn't change it through iterations, then all files would be uploaded to same name.

Re: multiple upload, only 1 file uploaded ?

by Arrow, Thursday, June 02, 2005, 23:19 (7113 days ago) @ wodSupport

Component may overwrite it internally if needed.

ok ...but the documentation does not mention this... it reads
as though you just have to set RemotePath and that value
will stay the same

setting RemotePath once when iterrating for GetFile works fine,
just PutFile shows this problem...(though i haven't used
other calls in a loop)

Re: multiple upload, only 1 file uploaded ?

by Arrow, Thursday, June 02, 2005, 23:32 (7113 days ago) @ Arrow

...anyway...other than that quirk, it works well and
will be ordering it :)