Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I just simply want to download an mp4 file via embedded server application using the code below;

http://videovlt is server application which is located under virtual pc. and the code below runs on an embedded server application which is running under my pc.

spath = "http://videovlt/videos/7bf9d10b-4006-4b44-9626-e3751df2f4ce.mp4"
fpath = "E:\videos\7bf9d10b-4006-4b44-9626-e3751df2f4ce.mp4"

C#
webClient.DownloadFile(spath, fpath);


But it gives "The remote server returned an error: (500) Internal Server Error."
error!
What is the reason for this?
I tried adding this but didn't work;
webClient.Headers.Add("user-agent", "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)");
Posted
Updated 28-Apr-15 3:14am
v2
Comments
Richard Deeming 28-Apr-15 9:14am    
What happens if you request exactly the same URL with your browser?

If it works in the browser, try using Fiddler[^] to compare the request from the browser to the request from your code to see what's different.
kubibay 28-Apr-15 9:43am    
When I request the url "http://videovlt/videos/7bf9d10b-4006-4b44-9626-e3751df2f4ce.mp4" then video plays. Same error on fiddler !

1 solution

The problem was source mp4 url was getting broken before consumed by embedded server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900