Skip to main content

Traditional file helper won't work in .Net core

Prior to .Net Core, we use to handle file by passing various sort of parameters, like -in memory bytes, FileStream or file path and that use to work perfectly. 

But when it comes to .Net Core, passing a file path will not work exactly as ASP.Net MVC. In earlier versions, the path we supplied was considered as a physical path whereas in Core, same API is used to denote the virtual path. In other words, whatever path is provided will be appended with site URL. 

Now how to give physical path in .Net Core? 
No worries! Here comes the PhysicalFile helper for our rescue. To know more about it, here you go.

Keep learning!

Comments