Is it possible to create an object that simply holds a file (either by reference or by memory). Then, if you want to move it via FTP or other means you can use that file reference.
private [some object type] CreateFileObject() {
[some object type] FileObj = new [some object type];
return FileObj;
}
At least three possibilities.
The file name of string type. You have it and can use it to do whatever with the file.
The native file handle of IntPtr type. I doubt it is as useful as it sounds as only native API works at handle level.
The reference to the stream of Stream type. Possibly mostly useful. You can read the content, reread and use any decorator streams on it (network streams, zip streams etc.). That would be my choice as it leverages the fact that the Base Class Library uses streams widely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With