# FilesController

**Kind:** Controller

**Source:** `Pams/API/Pams.API/Controllers/Common/FilesController.cs` (line 27)

**Part of:** [Pams](subsystem-pams)

## Where it refuses work

- `FilesController` stops the work with `HttpResponseException` when `!Request.Content.IsMimeMultipartContent()`, in 2 places.
- `FilesController` stops the work with an early return when `!success`, in 6 places.
- `FilesController` stops the work with an early return when `!ModelState.IsValid`, in 4 places.
- `FilesController` stops the work with an early return when `httpRequest.Files.Count <= 0`, in 2 places.
- `FilesController` stops the work with an early return when `parentId == 0`, in 2 places.
- `FilesController` stops the work with an early return when `stProvider == null`, in 2 places.

## When something fails

- `FilesController` handles failure in 20 places: it turns it into a return value in 18, and discards it silently in 2. A failure discarded silently leaves no trace for whoever debugs this later.

## Relationships

- MODULE_DECLARES → `GetbyParentFileID_old`
- MODULE_DECLARES → `GetbyParentFileId`
- MODULE_DECLARES → `GetLinkedFiles`
- MODULE_DECLARES → `GetTagsListByType`
- MODULE_DECLARES → `GetByID`
- MODULE_DECLARES → `DownloadFiles`
- MODULE_DECLARES → `DeleteTempAfterDownload`
- MODULE_DECLARES → `GetFromGoogleToOneDrive`
- MODULE_DECLARES → `UpdateFromGoogleToOneDrive`
- MODULE_DECLARES → `UploadFiles`
- MODULE_DECLARES → `UploadFileToOneDrive`
- MODULE_DECLARES → `UploadFileListToOneDrive`
- MODULE_DECLARES → `UploadFileToGoogleCloud`
- MODULE_DECLARES → `Save`
- MODULE_DECLARES → `EditFileCategory`
- MODULE_DECLARES → `SaveFileList`
- MODULE_DECLARES → `Delete`
- MODULE_DECLARES → `AttachFiels`
- MODULE_DECLARES → `AttachFiles`
- MODULE_DECLARES → `AttachFielsByTags`
- MODULE_DECLARES → `loadAttachedFiles`
- MODULE_DECLARES → `unAttachFile`
- MODULE_DECLARES → `LoadAttachments`
- MODULE_DECLARES → `LoadAllDocuments`
- MODULE_DECLARES → `GetRelatedObjectByCloudId`
- MODULE_DECLARES → `GetTagsListByTypeForOutlook`
- IMPORTS → `BaseController`
- IMPORTS → `CRMLinqDataContext`
- IMPORTS → `PamsLinqDataContext`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `File`
- IMPORTS → `Person`
- IMPORTS → `Project`
- IMPORTS → `Account`
- IMPORTS → `Employee`
- IMPORTS → `Task`
- IMPORTS → `Activity`
- IMPORTS → `Invoice`
- IMPORTS → `Payment`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `LetterOfGuarantee`
- IMPORTS → `InspectionSheet`
- IMPORTS → `InspectionDefect`
- IMPORTS → `StoreProduct`
- IMPORTS → `ProductionOrder`
- IMPORTS → `IssueNote`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `GetByID`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `Save`
- IMPORTS → `UploadFile`
- IMPORTS → `Comment`
- IMPORTS → `StorageFile`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `Update`
- IMPORTS → `RelatedToType`

## Used by

8 references from 8 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### calls by (8)

- `UploadFilePopup` — `Frontend/src/app/services/common/files.service.ts`:1
- `Attachement` — `Outlook_plugin/src/attachement/attachement.service.ts`:1
- `Auth` — `Outlook_plugin/src/auth/auth.service.ts`:1
- `UploadFilePopup` — `Pams/Web/Pams.Web/Client/app/services/common/files.service.ts`:1
- `FilesService` — `Pams/Web/Pams.WebApp/Client/app/services/common/files.service.ts`:1
- `AppSettings` — `Frontend/src/app/settings/app/app.settings.ts`:241
- `AppSettings` — `Pams/Web/Pams.Web/Client/app/settings/app/app.settings.ts`:126
- `AppSettings` — `Pams/Web/Pams.WebApp/Client/app/settings/app/app.settings.ts`:6
