1
votes

So far all the samples on azure regarding azure media services, expect that files in general must be stored locally in order to upload to azure media services.

The reason being is that the CreateFromFile() has two parameters: string filePath and options.

Example:


static public IAsset UploadFile(string fileName, AssetCreationOptions options)
{
    IAsset inputAsset = _context.Assets.CreateFromFile(
        fileName,
        options,
        (af, p) =>
        {
            Console.WriteLine("Uploading '{0}' - Progress: {1:0.##}%", af.Name, p.Progress);
        });

    Console.WriteLine("Asset {0} created.", inputAsset.Id);

    return inputAsset;
}

Now what if the video has been passed in the body of a post API? How would one try to approach such a challenge?

1

1 Answers

0
votes

So far all the samples on azure regarding azure media services, expect that files in general must be stored locally in order to upload to azure media services.

It also supports to create IAsset from the blob CreateFromBlob, but it seems that creating IAsset from stream is not supported now. I also find an issue about this.

Now what if the video has been passed in the body of a post API? How would one try to approach such a challenge?

In your case if I understand correctly, you could save the files in you API server template folder/another Azure blob storage then delete it template files/blobs after finish the action.