Search Results for

    Show / Hide Table of Contents
    View Source

    Interface ITemporaryFileService

    Provides functionality for managing temporary files used during uploads and other operations.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface ITemporaryFileService
    Remarks

    Temporary files are stored for a limited time and are automatically cleaned up.

    Methods

    View Source

    CleanUpOldTempFiles()

    Cleans up expired temporary files.

    Declaration
    Task<IEnumerable<Guid>> CleanUpOldTempFiles()
    Returns
    Type Description
    Task<IEnumerable<Guid>>

    A collection of keys for the temporary files that were cleaned up.

    View Source

    CreateAsync(CreateTemporaryFileModel)

    Creates a new temporary file.

    Declaration
    Task<Attempt<TemporaryFileModel?, TemporaryFileOperationStatus>> CreateAsync(CreateTemporaryFileModel createModel)
    Parameters
    Type Name Description
    CreateTemporaryFileModel createModel

    The model containing the file data and metadata.

    Returns
    Type Description
    Task<Attempt<TemporaryFileModel, TemporaryFileOperationStatus>>

    An attempt containing the created temporary file model if successful, or an operation status indicating failure.

    View Source

    DeleteAsync(Guid)

    Deletes a temporary file by its key.

    Declaration
    Task<Attempt<TemporaryFileModel?, TemporaryFileOperationStatus>> DeleteAsync(Guid key)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the temporary file to delete.

    Returns
    Type Description
    Task<Attempt<TemporaryFileModel, TemporaryFileOperationStatus>>

    An attempt containing the deleted temporary file model if successful, or an operation status indicating failure.

    View Source

    GetAsync(Guid)

    Gets a temporary file by its key.

    Declaration
    Task<TemporaryFileModel?> GetAsync(Guid key)
    Parameters
    Type Name Description
    Guid key

    The unique identifier of the temporary file.

    Returns
    Type Description
    Task<TemporaryFileModel>

    The temporary file model if found; otherwise, null.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX