I have an API with a specific endpoint used by some applications to send images.
[HttpPost("dropimage")]
public string UploadImage([FromForm] IFormFile file)
{
try
{
string FileName = file.FileName;
string uniqueFileName = Guid.NewGuid().ToString() + "_" + FileName;
var imagePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images/", FileName);
file.CopyTo(new FileStream(imagePath, FileMode.Create));
return "Successful";
}
catch (Exception ex)
{
return ex.Message;
}
}
This is working fine and files are correctly received within wwroot/images
folder.
Note: this .NET Core 7 app is deployed on Debian 10 (dotnet7.0.102 actually)
My question
I want to copy the file, once received, to another file server (Rhel server 7.9).
As servers used are Linux based, I thought I could use a mount point to do so (it should work), but is there any possibility to do it programmatically (in case I have a Windows server)?
I saw some posts (this one or this one) about this subject, unsuccessful yet.
Can someone please point me in the right direction ?
Regards,
Pierre