I've now tested both locally and in the test environment. Some times all has worked out fine. Some times I get this error:
I have saved Content.definition and have run Ensure all database fields, Ensure base data and Ensure data integrity
Server error: Access to the path 'D:\www\testweb.xxx.no\data\WAF\Files\Content\2681590\103572\2021dde8-6fb3-4c94-a27c-262b2e467bb8\image.jpg' is denied.
URL: https://testweb.xxx.no/wafapi/upload/MoveToFileProperty?uploadId=fff60c89-48fb-40dc-8329-15fde4ddcefc&propertyPath=6078f477-9d67-44d5-abd3-1a037188f6e9%7C1044%7C0%3C224b69b0-5a96-4c1c-8495-73ebef2b0483&fileIndex=0&autoCrop=false&keepOldFile=false
Error type: UnauthorizedAccessException
Server stacktrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at WAF.Engine.FileSystem.FileSystemProviderDefault.FileMove(String sourceFileName, String destFileName)
at WAF.Data.DataAccessObject.UpdateContent(ContentData contentData, Int32 userId)
at WAF.Data.DataAccessObject.UpdateContent(List`1 changedContentDataList, Int32 userId)
at WAF.Engine.WAFEngine.UpdateContent(List`1 contentDataList, WAFSession WAFSession)
at WAF.Engine.WAFSession.UpdateContent(List`1 contents)
at WAF.Engine.Content.ContentBase.UpdateChanges(Boolean updateChangeDate, Boolean invokeEventMethods, Boolean queChangesForIndexing, Boolean validateValues)
at WAF.Engine.Content.ContentBase.UpdateChanges()
at WAF.API.NativeTempStore.MoveToFileProperty(ISession session, ContentPropertyPath propertyPath, Guid collectionId, Int32 fileIndex, Boolean autoCrop, Boolean keepOldFile)
at WAF.Server.Controllers.APIUploadController.MoveToFileProperty(Guid uploadId, String propertyPath, Int32 fileIndex, Boolean autoCrop, Boolean keepOldFile)