ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 255.6k

when copy file get error The target file is a directory, not a file

May 25 2021 11:18 AM
I work on asp.net core 3.1 web api
I get exception error as below :
Exception The target file is a directory, not a file. on file.copy
this lines generated exception
System.IO.File.Copy(OutputfilePath, Path.Combine(exportDirectory, fileName), true);
two files can access and open it when i open on fil explorer but issue
as above
so How to solve this issue please ?
 
what i try  as below :
 
 

Answers (4)