PutFile and stream problem - WeOnlyDo Discussion board

PutFile and stream problem (wodSFTP / wodSFTP.NET / wodSFTPdll)

by subcubes, Wednesday, December 21, 2005, 20:29 (6726 days ago)

Hi

Im trying to use PutFile, from a FileStream, like so:

FileStream fs = new FileStream(m_PutFiles[0].LocalFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

m_SFTPPutFileInstance.PutFile(fs, m_PutFiles[0].RemoteDirName);


But it doesn't upload anything - and I don't get any Errors from DoneEvent. Im not using blocking.

Also, Ive surfed this forum to see if any other had the same issue - and thought I read something about, that ProgressEvent is not fired when I PutFile with a Stream, is this correct?

Regards
Torben Lajer

Re: PutFile and stream problem

by wodSupport, Wednesday, December 21, 2005, 20:39 (6726 days ago) @ subcubes

Torben,

Progress should fire.

Does your code work if you try to call PutFile with filename as argument?

If you don't use blocking mode, is it possible that wodSFTP is destroyed before it even starts uploading (i.e. if you declared it locally)?

Re: PutFile and stream problem

by subcubes, Wednesday, December 21, 2005, 20:45 (6726 days ago) @ wodSupport

Does your code work if you try to call PutFile with filename as argument?

Yes, then it works without any problems.

No, Its not possible that wodSFTP is destroyed before uploading (ie. it works when I just use the filename as argument), I made fairly sure of that, by setting a member boolean to true when connected.

If nessasary, I could paste some code?

Re: PutFile and stream problem

by wodSupport, Wednesday, December 21, 2005, 20:46 (6726 days ago) @ subcubes

How about you zip your code and send it over to techsupport? I'm affraid code fragment will not help, I need to see the big picture .