@@ -189,8 +189,7 @@ private bool IsAllowedInDataTypeConfiguration(string extension, object? dataType
189
189
}
190
190
191
191
// get the filepath
192
- // in case we are using the old path scheme, try to re-use numbers (bah...)
193
- var filepath = _mediaFileManager . GetMediaPath ( file . FileName , contentKey , propertyTypeKey ) ; // fs-relative path
192
+ string filepath = GetMediaPath ( file , dataTypeConfiguration , contentKey , propertyTypeKey ) ;
194
193
195
194
using ( Stream filestream = file . OpenReadStream ( ) )
196
195
{
@@ -201,9 +200,19 @@ private bool IsAllowedInDataTypeConfiguration(string extension, object? dataType
201
200
202
201
// TODO: Here it would make sense to do the auto-fill properties stuff but the API doesn't allow us to do that right
203
202
// since we'd need to be able to return values for other properties from these methods
204
- _mediaFileManager . FileSystem . AddFile ( filepath , filestream , true ) ; // must overwrite!
203
+ _mediaFileManager . FileSystem . AddFile ( filepath , filestream , overrideIfExists : true ) ; // must overwrite!
205
204
}
206
205
207
206
return filepath ;
208
207
}
208
+
209
+ /// <summary>
210
+ /// Provides media path.
211
+ /// </summary>
212
+ /// <returns>File system relative path</returns>
213
+ protected virtual string GetMediaPath ( TemporaryFileModel file , object ? dataTypeConfiguration , Guid contentKey , Guid propertyTypeKey )
214
+ {
215
+ // in case we are using the old path scheme, try to re-use numbers (bah...)
216
+ return _mediaFileManager . GetMediaPath ( file . FileName , contentKey , propertyTypeKey ) ;
217
+ }
209
218
}
0 commit comments