This project is read-only.


Topics: Core, Customizing Orchard, Writing modules
Feb 12, 2012 at 10:09 AM

The IMediaService allows us to upload files, but it doesn't seem to provide an option to overwrite existing files, nor does it seem to allow us to check if a certain file exists. I think this would make for a nice feature, unless there is already support for overwriting files that I am missing?

Feb 12, 2012 at 12:16 PM
Edited Feb 12, 2012 at 12:17 PM

The current implementation of IMediaService uses IStorageProvider that lacks this feature (I've implemented FileExists() and FolderExists() in a fork, but since this is an interface change, would break existing implementations; developers could be warned in advance, though) as well as there is a feature request for IMediaService too.

Feb 12, 2012 at 12:20 PM

Excellent, I just voted for both feature requests. I hope that your fork will be included in the main branch, as it would simplify uploading media for me. Right now, I'll just catch the exception whenever a file exists, remove the file, then try again.