Coder Social home page Coder Social logo

Comments (12)

robinrodricks avatar robinrodricks commented on May 17, 2024 1

@jaxidian Its now called Download() and Upload() for the stream/byte versions to make it more discoverable.

from fluentftp.

robinrodricks avatar robinrodricks commented on May 17, 2024

I thought of that too, but I didn't know how to implement it. Would it create a new MemoryStream and return that? The byte[] version is obvious and can easily be implemented. However since its a different return type, an overload will be impossible. So the API will get a bit messed up:

  • UploadFile() -- 3 overloads
  • DownloadFile() -- download and save to disk
  • DownloadFileAsBytes() -- new
  • DownloadFileAsStream() -- new

from fluentftp.

natiki avatar natiki commented on May 17, 2024

How about out params that are either a stream or a byte array?

from fluentftp.

robinrodricks avatar robinrodricks commented on May 17, 2024

Okay so something like:

  • DownloadFile (string, string)
  • DownloadFile (string, out byte[])
  • DownloadFile (string, out Stream)

Would that be discoverable? Anyways I think as an overload that should be pretty easy to discover. What do you think?

from fluentftp.

natiki avatar natiki commented on May 17, 2024

That looks good to me. It would come up nicely in code completion so be discoverable IMHO.

from fluentftp.

robinrodricks avatar robinrodricks commented on May 17, 2024

Done. Published to nuget as https://www.nuget.org/packages/FluentFTP/16.0.19

Sadly the byte[] and other versions appear in VS autocompletion before the string version. Do you know how to ask VS to prefer a certain overload?

from fluentftp.

robinrodricks avatar robinrodricks commented on May 17, 2024

Can you also test those methods to see if they work in your use case? I was going to use out Stream but decided to go with Stream since it allows the user to write data into any stream, whereas with out Stream I'm forced to create a new MemoryStream and set it into the var for C# to accept it.

from fluentftp.

natiki avatar natiki commented on May 17, 2024

Hi Harsh,

The stream version works for me in my use case. Only thing that may need consideration is that there is still an OverwriteFile parameter. This is redundant as the file is being written to a stream so I don't think that should be there anymore as a parameter.

from fluentftp.

robinrodricks avatar robinrodricks commented on May 17, 2024

Good points. Yes, I already discovered the overwrite parameter and removed it in the latest version.

from fluentftp.

robinrodricks avatar robinrodricks commented on May 17, 2024

I've made improvements to this in the latest version. You can fetch it from nuget. Can you see if everything works ok? (the stream/byte API)

from fluentftp.

jaxidian avatar jaxidian commented on May 17, 2024

@hgupta9 Was this removed? I just updated to 17.x from 16.5.0 and I'm not seeing this in the 17.4.1 release. Was this moved to a different function or was it completely removed? If it was completely removed, can we get this back in? I'll be staying on 16.x until this works itself out.

from fluentftp.

jaxidian avatar jaxidian commented on May 17, 2024

@hgupta9 Ahh, that'd be what I'm looking for. I could have sworn that I looked for renamed versions and couldn't find something - I guess I just didn't look hard enough. Thanks!

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.