maxiomtech / DotNetNuke-FileWatcher

Monitors the files in your portals folder and instantly adds or removes them from the database. This is useful if you FTP or use explorer to copy files to your website.
15 stars 4 forks source link

File based caching causes attempt to sync which throws an error #1

Open lucasjans opened 10 years ago

lucasjans commented 10 years ago

The file based caching causes the watcher to trigger, which throws this error.

DotNetNuke.Services.FileSystem.InvalidFileExtensionException: The extension '.resources' is not allowed. The file has not been added.
   at DotNetNuke.Services.FileSystem.FileManager.AddFile(IFolderInfo folder, String fileName, Stream fileContent, Boolean overwrite, Boolean checkPermissions, String contentType, Int32 createdByUserID)
   at DotNetNuke.Services.FileSystem.FileManager.AddFile(IFolderInfo folder, String fileName, Stream fileContent, Boolean overwrite, Boolean checkPermissions, String contentType)
   at DotNetNuke.Services.FileSystem.FileManager.AddFile(IFolderInfo folder, String fileName, Stream fileContent, Boolean overwrite)
   at InspectorIT.FileWatcher.Components.FileMonitor.onFileChanged(Object sender, FileSystemEventArgs e, PortalInfo portalInfo)

I will put in a pull request to fix it. Should we not throw an error for file types that are excluded? Maybe a warning? Or perhaps certain types of files should be ignored?

jsheely commented 10 years ago

Yes, That's a good idea. Only the files types in the include Host Settings include list should added.