<<

NAME

Koha::UploadedFile - Koha::Object class for single uploaded file

SYNOPSIS

    use Koha::UploadedFile;

    # store record in uploaded_files
    my $upload = Koha::UploadedFile->new({ [columns and values] });

    # get a file handle on an uploaded_file
    my $fh = $upload->file_handle;

    # get full path
    my $path = $upload->full_path;

    # delete uploaded file
    $upload->delete;

DESCRIPTION

Allows regular CRUD operations on uploaded_files via Koha::Object / DBIx.

The delete method also takes care of deleting files. The full_path method returns a fully qualified path for an upload.

Additional methods include: file_handle, httpheaders.

METHODS

INSTANCE METHODS

delete

Delete uploaded file. It deletes not only the record, but also the actual file (unless you pass the keep_file parameter).

Returns number of deleted records (1 or 0E0), or -1 for unknown. Please keep in mind that a deleted record does not automatically imply a deleted file; a warning may have been raised. (TODO: Use exceptions.)

full_path

Returns the fully qualified path name for an uploaded file.

file_handle

Returns a file handle for an uploaded file.

httpheaders

httpheaders returns http headers for a retrievable upload.

Will be extended by report 14282

CLASS METHODS

permanent_directory

Returns root directory for permanent storage

tmp_directory

Returns root directory for temporary storage

_type

Returns name of corresponding DBIC resultset

AUTHOR

Marcel de Rooy (Rijksmuseum)

Koha Development Team

<<