Giter VIP home page Giter VIP logo

Comments (4)

robinrodricks avatar robinrodricks commented on May 22, 2024 1

Can you please add a separate issue for this as I see no connection with the OP's issue. And if you can use my code as a reference instead of coding from scratch; basically I upload in chunks, and various other stuff that might be useful and/or might solve your problem automatically. Please see UploadFileInternal

from fluentftp.

robinrodricks avatar robinrodricks commented on May 22, 2024

This is an issue in FluentFTP. I'm working on this. The error is because the data stream used for writing the file is parallel to the FTP control stream. I need to find a way to delay the control stream so race conditions don't occur. I'll be adding the alt version in another API, probably called UploadFile() or similar. I'll let you know when its ready.

from fluentftp.

robinrodricks avatar robinrodricks commented on May 22, 2024

I have fixed this in 16.0.17 if you use the high level UploadFile and DownloadFile API. This is the code I used to test:

static void TestUploadDownloadFile() {

	using (FtpClient cl = new FtpClient()) {
		cl.Host = m_host;
		cl.Credentials = new NetworkCredential(m_user, m_pass);

		// 10 M file
		cl.UploadFile(@"D:\bigfile.exe", "/public_html/temp/big.txt");
		cl.Rename("/public_html/temp/big.txt", "/public_html/temp/big2.txt");
		cl.DownloadFile(@"D:\bigfile_2.exe", "/public_html/temp/big2.txt");

	}
}

Please check with the latest version and see if it solves your problem.

from fluentftp.

tobiasps avatar tobiasps commented on May 22, 2024

Hi @hgupta9,
I'm using the low-level commands for uploading to be able to get progress info, ie. OpenAppend/OpenWrite and stream methods Write, Flush, then Close and Dispose.
After completed upload I'm calling Rename on the client, however what I'm seeing is that theres is a long wait before the Rename completes. Also if I do not insert a thread delay I get an exception on the rename command. Furthermore the bigger the file the longer the delay.
I am really impressed by the transfer speed, but unfortunately it takes longer renaming the file than transferring it. I'm testing with files larger than 100MB and I'm using the FluentFTP in a Xamarin project for iOS and Android.
I upload to a temporary name and then rename as I have a backend software that watches the upload folder.

Can I do anything to shorten the delay?

I have also tried disconnecting and reconnecting, in this case the disconnect is delayed. Once reconnected the rename is instantaneous.

from fluentftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.