Renci SSH NET Upload Large File Failure - ssh.net

I've been using a .NET DLL by Renci SSH NET which transfers the files from local machine to secure FTP. It was working fine for small files but this has a problem while uploading large files through my application. I increased the buffer time, operation time out but it still doesn't upload. When I debugged my code, it stuck at the point where I'm uploading & it does not even throw any error.
Any Suggestions Please?
Thanks

Per your description, it's not clear if the issue caused by your codes or by the SFTP server, so I would like to suggest:
Use a ftp client to upload the same file to the SFTP server to see if that OK.
If OK, then you can use network monitor tool, such as wireshark, tcpdump, to check if the issue is caused by network unstable.
Also, by using the network monitor tool, you can check if the upload process stop at the same point every time.
Hopefully that would helpful.

Related

windows smb connection, can't fix system error 53

This issue tortures me days and still can't fix it: I have a file share server and I can access it from my windows client.
From the client, I am using net use command to connect the file share by using some specific user like:
net use y: \ia0.myserver.com\fs Password123! /user:corpuser2258#myserver.com
I have a script, which uses net use to connect to share by an user, do some file operations, then disconnect from share.
The script will loop on different users to do the above things. The problem is, script is doing well, until about 200 hundreds of loops, then net use will fail. The system error 53 has occurred.
At this point, my client cannot connect to the share anymore. I searched a lot on webs and tried various methods mentioned, like reboot netbios or other related services, but none of them can work.
The only way for now is reboot client, and then everything is back to normal.
Since the scrip works fine every time for the first hundreds of users, there should be no network or server issue. As long as I reboot client the system error 53 issue will gone. It looks like something in client should be rebooted or change to some initial state but I can't fingure out.
I hope someone could help to identify and fix the problem, thanks.
Can you give any other info like network capture (wireshark)

Opening network file from excel vba code on MAC uses offline file

I have excel with macros run in Mac OS.
One of the macros uses Workbooks.Open to open a file in network folder (a SharePoint site).
It works fine if there is connection into the network.
Also it works fine if the user of the Mac profile runs the macro for the first time with the network connection on or off. If there is no connection Mac returns error like it should when run first time.
However the problem is that after the user has succesfully used the file (macro) with the connection on once then Workbooks.Open does not return any error when running the macro second time and the network connection is down.
I added exit sub command right after the Open method and could see that there is same network file open on excel with status of 'Offline file'. That file was the same as the one previously opened when using the macro with network open for the first time. However the file was not fetched from the network drive as this time there is no connection to network.
Tried to find the file from Mac file system, without success.
What creates the offline copy and where is it stored?
How to delete the offline file via vba code or how to prevent excel (or Mac) from creating it ever again?
Br,
MikkoT
You should disable oplocks in the SMB protocol.
Oplocks are opportunistic locks, a client-side performance enhancement
that requires cooperation between a Windows client and the SMB
service. If SMB service supports oplocks, the client can request to
cache a file locally, in order to perform read and write operations on
the cached file rather than directly on the server. This saves network
bandwidth and increases performance for the SMB client. If another SMB
client requests access to the file, the SMB service notifies the
holder of the oplock, and that client should write changes from its
cache back to the SMB service. The SMB service does not let another
client have access to the file until the first client has finished
writing.

How can I perform a server to server file transfer

I would like to copy a site which is currently being hosted live on an easyspace web domain to another domain that is hosted by the web company Parallels. I wondered if there was a way of doing this without fist taking the site down and copying the files back to the local server, then re-uploading them again.
If anyone has any advice on this, I would be most grateful!
Regards,
Robert Y
It is necessary to check if fxp protocol (that is a protocol that supports file transfer between servers) is supported by both servers: but usually is disabled for security reasons. If it is active (make a question to your host admin) than you can use a fxp software as FlashFXP, SmartFTP or FTP Rush (Freeware) or similar sw.
SUPER FAST:
For direct Server to Server file transfers: if you know your ftp url or ip address you can use FlashFXP (not related to adobe flash)
Make a zip file that contains all the live files on your target server. You can do this via command line or easier through your server's cPanel. Compression Time depends on your server's CPU speed and quantity & size of files.
Download a copy of FlashFXP it works well and has a free trial
http://www.flashfxp.com/download
Log-in to your target server, navigate to directory with your target files.
Log-in to your destination server, navigate to directory to store transfered files.
Once connected & directories are visually lined-up... just drag and drop desired files into desired directory on opposing server.
Overall transfer speed depends on internet backbone traffic & each servers connection + cpu speed & throttling controls between your two servers. GOOD NEWS the speed is NOT reliant on your cable modem's connection speed. No slow download and then even slower upload, just a clear straight shot to the other server.
This FlashFXP Server to Server video tutorial is nice --> https://www.youtube.com/watch?v=6XXQgeRWWRw

WNetAddConnection2 works with wrong credentials

i've got a strange problem with using WNetAddConnection2.
First of all i connect to a WebDAV folder with correct server name, user name and password.
Connection get established as expected and i can see the mounted drive with the windows explorer.
After that i call WNetCancelConnection2 to remove the mounted drive. Works fine and it disappears from the explorer.
Now there comes the strange behaviour. If i try to connect again to the server it does not matter what password i use, i can take a totally wrong one and the drive get mounted again without any problems. Seems that Windows caches the connection.
I found out that it takes exactly one minute and after that time trying to connect will bring up the expected error message.
My question is if this 60 seconds timeframe is adjustable or what other thing i can do to avoid this behaviour.
Thanks in advance for your help.

How to get and send files from an application to another machine or Windows Explorer but not another application?

Sorry if my question is confusing but what I am looking to do is this. I am creating an application that is supposed to send and receive files directly to another machine without having to connect to any other application but the windows explorer on another machine. I know you can write a client and server much like a FTP program, but that's not what I am looking for. An application simply connects to Windows or windows explorer on another machine for sending or receiving files.
I have looked or researched for information online, but not much to look at.
Is there a way to do this? If so, how.
MORE INFO:
I want to be able to start my application on a machine and send and receive files automatically from or to another local machine without establishing any direct connection very much like what Microsoft Window does. You open your windows explorer and drag and drop files from or to another machine. Only that I want to do that programmatically within my application. I start my application and simply request or send for specific file at a specific location. The way I have it written now you have to run two different copies of the same program on different machines - one as a server and the other as a client.
Maybe what I am looking for is a way to get access to the filesystem of another local machine without socket to socket connection.
Thanks in advance.
Windows Explorer is not an application that foreign programs can "connect" to. You need to connect to something that will actually be listening for connections. The most direct way would probably be to set up a network share on the server and then use WNetAddConnection2 to connect to that share on the client.

Resources