Skip to content

Filesize function only properly works if using native WordPress storage #180

@ddbradshaw

Description

@ddbradshaw

I have a client that doesn't use the native WordPress storage for files, instead they use Windows Azure for file storage. This being the case, the file_exists method always returns false. Here's a workaround that worked for me in the class.attachments.php

$head = array_change_key_case(get_headers($file_path, TRUE));
$filesize = $head['content-length'];
$formatted = size_format( $filesize );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions