Usman Bajwa on Fri, 28 Oct 2016 05:11:57
I want uploading file on media services. When I upload file it gives exception after some time. here is the exception
Remote Server returns 500 Internal Server Error
Here is my uploading code: I am geeting exception at assetFile.Upload(filePath);public static string UploadFile(string filePath)
string assetId = null;
CloudMediaContext _context = GetContext();
string assetName = Path.GetFileNameWithoutExtension(filePath);
IAsset Asset = _context.Assets.Create(assetName, AssetCreationOptions.None);
IAssetFile assetFile = Asset.AssetFiles.Create(Path.GetFileName(filePath));
var policy = _context.AccessPolicies.Create(
AccessPermissions.Write | AccessPermissions.List);
ILocator locator = _context.Locators.CreateLocator(LocatorType.Sas, Asset, policy);
assetFile.Upload(filePath); // Getting Exception at this line
return assetId = assetFile.Asset.Id;
catch (Exception e)
Wendy Zang on Fri, 28 Oct 2016 07:37:20
Hi Usman Bajwa,
Thank you for posting here.
Since your problem is more related to Azure Media Service, I will move it to Azure Media Services Forum for support.
The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.
If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.
Thanks for your understanding and cooperation.