title: Filestream renaming file
body: <p>I'm trying to read a file as filestream, renaming the file, and send the file in the form of filestream to a Document Management System(DMS).</p>
  
  <p>I've seen so many questions in StackOverflow asking about renaming the file in c#, and most of the reply suggested using File.Move .</p>
  
  <p>However, I was wondering If don't want to actually rename the file, and I would like rename to file once the file has become filestream. I want to explore the alternative solution other than File.Move. </p>
  
  <p>I've tried to rename the file by the following approach, however, It seems that the name property of filestream object is read-only.</p>
  
  <pre><code>//This is my attempt
  FileStream fs = new FileStream()
  fs.Name = "new_name" //&lt;-- not working
  </code></pre>
  
  <p>Additional Info:</p>
  
  <p>Yes, I'm now trying to amend some legacy code without proper documentation, where the code apparently indicated that the library of the DMS has a parameter to pass a filestream object into it and upload. Therefore, I assumed the DMS does read the Name property of the filestream. </p>
  
  <p>The reason why I want to directly change the name of the filestream is that I want to change at least as possible since the one who wrote this code has already gone and I also don't have the document of the DMS. Also, the document will be stored after finished uploading, this is the reason why I don't want to change to name of the document.</p>
  
  <pre><code>//This is how the actual program code looked like
  FileStream input = File.OpenRead(uploadFile_path);
  obj.Update();
  obj.Fetch();
  </code></pre>
  
  <p>But after listening to all your suggestion, I think the safest way to solve this problem will be:</p>
  
  <ol>
  <li>Create a copy of the file</li>
  <li>Rename the copy of the file</li>
  <li>Upload the filestream of the file</li>
  <li>Remove the file</li>
  </ol>