Skip to content

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

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 );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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