Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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