Comments (12)
@jaxidian Its now called Download() and Upload() for the stream/byte versions to make it more discoverable.
from fluentftp.
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.
How about out params that are either a stream or a byte array?
from fluentftp.
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.
That looks good to me. It would come up nicely in code completion so be discoverable IMHO.
from fluentftp.
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.
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.
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.
Good points. Yes, I already discovered the overwrite parameter and removed it in the latest version.
from fluentftp.
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.
@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.
@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)
- GetWorkingProfileFromHost: Destination array was not long enough HOT 9
- IBM FTP Server returns error: File must be specified by library/file.member HOT 26
- Code quality: For example: NonStopParser.cs Do not ignore method results HOT 4
- Ftp EPSV download from public site fails with IOException HOT 5
- Upload fails after period of inactivity HOT 14
- Uploading files gives 500 NLST not understood error HOT 9
- IsConnected / IsAuthenticated properties can be misleading HOT 36
- [Feature] Real Time Sync HOT 1
- Libs not included into CLickOnce publish app root folder HOT 23
- FTP Transfer is not working in Active mode HOT 6
- Progress should include all operations of a single file transfer HOT 16
- Problem transfering file with particular FXP destination server HOT 4
- DownloadStream method ignores stopPosition HOT 2
- Download with stopPosition overdownloads within last chunk, breaks progress report too HOT 7
- Multi-File operations should provide a overall progress HOT 13
- How often do you update NuGet? HOT 2
- Release page and release tags are missing HOT 1
- Request for Nuget 49.0.2 HOT 4
- Question about 'DownloadDirectory()' HOT 1
- Error using clone function with async client HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentftp.