简体   繁体   中英

Angular 8/9 and Virtual folder (IIS and localhost) issue

I have created a virtual folder in Angular 8/9 under assets folder to store some of my mp4 videos. My environment is Windows 10 and VS2019 and my project has been create using Microsoft Angular template (Angular and MVC integrated).

The issue is that I can not play the mp4 file if the folder is the virtual folder. However, if it is a real folder, then I can play the mp4 file fine. I already set up permission to the virtual folder and it is still not working. I did search for solutions and suggestions but I don't see any one has the issue.

The other thing I have looked is that if i type full address to the browser (for example https:\localhost\assets\videos\myvideo.mp4), the browser directs me to the home page instead. Do you think it is router issue? If it is router issue, how do I correct it?

Please advise. Thank you

This is what I have to do to make it to work (just in case that someone may run into this issue like me -- it saves a lot of times).

The url https:\\localhost\assets\videos\myvideo.mp4 is not working if the videos folder is a virtual folder (note: it works if it is real folder).

This 'https:\\localhost\clientapp\dist\assets\videos\myvideo.mp4' is WORKING if videos folder is a virtual folder.

Thank you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM