SaaS CMS has officially launched! Learn more now.
AI OnAI Off
SaaS CMS has officially launched! Learn more now.
Try this! 😁
[UIHint(UIHint.MediaFile)]
public virtual ContentReference CsvFile { get; set; }
public string GetCsvFileContent()
{
if (!ContentReference.IsNullOrEmpty(CsvFile))
{
var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
var contentFile = contentLoader.Get<MediaData>(CsvFile);
using (var sr = new StreamReader(contentFile.BinaryData.OpenRead()))
{
return sr.ReadToEnd();
}
}
return null;
}
Hello,
We have requirement to bulk update the meta tag details from a .csv file. We have a contentreference field to hold the .csv file and fetching the file using contentrepository. Now trying to read the file using streamreader() or file.readalltext() which will not work in this context.
Can any one guide how to deal this scenario?
Many Thanks,
Deepa