Is there any way to get the file extension from a URL

前端 未结 7 1328
囚心锁ツ
囚心锁ツ 2021-02-12 06:48

I want to know that for make sure that the file that will be download from my script will have the extension I want.

The file will not be at URLs like:

h         


        
7条回答
  •  一向
    一向 (楼主)
    2021-02-12 07:34

    VirtualPathUtility.GetExtension(yourPath) returns the file extension from the specified path, including the leading period.

提交回复
热议问题