Skip to content

add MediaField (Image) programmable from URL? #7208

Discussion options

You must be logged in to vote

This is what i did, if some one need


private const string TestFileRelativePath = "folder/name.jpg";

   public async Task CreateFileInFolder(string filePath)
        {
            using (HttpClient c = new HttpClient())
            {
                using (Stream stream = await c.GetStreamAsync(filePath))
                {
                    await _mediaFileStore.CreateFileFromStreamAsync(TestFileRelativePath, stream, true);
                }
            }
         }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@vitalybrandes
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by vitalybrandes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants