Add file to MediaField #9691
Answered
by
lampersky
vitalybrandes
asked this question in
Q&A
-
I am programmably update ContentItem with adding file to MediaField.
Actually, i found that that this replace the existing data from part.BackupFile to new one, instead add. What i am doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
lampersky
Jun 15, 2021
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vitalybrandes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
part.BackupFile = new MediaField { Paths = new string[] { FilePath } };
This line replaces current Paths value, with single item array.
Maybe try to read Paths first, append additional item and save it back.