Reputation: 219
I have web app that write video files to folder inside project
After this it display video to view
With writing is all ok.
But when I try to display video I get this error
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
When I run website on local machine all okay and video is displaying
I face this problem only on hosting (Azure)
Here is code of controller
[HttpPost]
public ActionResult PostRecordedAudioVideo()
{
foreach (string upload in Request.Files)
{
var path = AppDomain.CurrentDomain.BaseDirectory + "uploads/";
var file = Request.Files[upload];
file?.SaveAs(Path.Combine(path, Request.Form[0]));
}
return Json(Request.Form[0]);
}
Interesting thing in this. I see this file in folder when connect to server via ftp
But in console I have this
Where my problem may be?
Upvotes: 2
Views: 144
Reputation: 219
Just need to write this in config
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".webm" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
</staticContent>
</system.webServer>
Upvotes: 0
Reputation: 1075
Probably not entirely the answer you're looking for, but you might want to look into storing your video files in Azure blob storage:
If you use blob storage, you offload the video traffic from the webapp by either linking to the file directly in a public container, or by generating a SAS token on-the-fly for controlled access.
Upvotes: 1