How can I force creation of the file on upload even if the directory does not exist
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
How can I force the creation of the file on upload even if the directory does not exist something similar creating file and recursively creating directories
using (SftpClient sftp = new SftpClient(ipSftpServer, portSftpServer, userSftp, passSftp))
{
sftp.Connect();
memoryStream.Seek(0, SeekOrigin.Begin);
sftp.UploadFile(memoryStream, '/var/local/dcm4chee-arc/wildfly/data/fs1/2021/02/01/0A06A0AF/0DECCF06/F96DE23E".dcm',
delegate (ulong d)
{
if(uploadCallback != null)
{
uploadCallback((long)d, bytesTotal);
}
});
Console.WriteLine($"end of file copy");
sftp.Disconnect();
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the SftpClient.UploadFile call shown in the issue and review the SFTP path and parent-directory behavior in the public API documentation. Done would be a supported way to upload when the nested destination directory is absent, with the expected behavior verified for the path shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100