Hi, what version of Umbraco are you on? For 7+ you can use the Media service like so:
var media = Services.MediaService.GetById(1072);
var umbracoFilePath = media.GetValue<string>(Umbraco.Core.Constants.Conventions.Media.File);
var path = Server.MapPath(umbracoFilePath);
using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{
}
Media File stream
Hi,
Is it possible to get a file stream from a media item?
The back-end user upload a PDF File to the media library, With a Media Picker, the same user selects this item to add it to a page.
From the current page, I get the id of the media item. But now I need a stream so i can edit the file.
Any idea how I can get this done?
With kind regards,
Jan van Helvoort.
Hi, what version of Umbraco are you on? For 7+ you can use the Media service like so:
We are running currently version 6.1.6
Because of a package we need for this site.
is working on a reply...