Giter Club home page Giter Club logo

Comments (3)

cuneytsenturk avatar cuneytsenturk commented on May 25, 2024

Hello,

This issue is the reason for your upload file size. This exception function ;

    /**
     * Calculate the file size in human readable byte notation.
     * @param  int $precision (_optional_) Number of decimal places to include.
     * @return string
     */
    public function readableSize(int $precision = 1): string
    {
        return File::readableSize($this->size, $precision);
    }

from akaunting.

feralhipichik avatar feralhipichik commented on May 25, 2024

Thanks for that info... is it necessary or can it be commended out? Can I change it to something that won't cause an issue?

from akaunting.

cuneytsenturk avatar cuneytsenturk commented on May 25, 2024

The error message indicates that there is an issue in the Plank\Mediable\Helpers\File::readableSize() method call in the Media.php file on line 308. The error specifies that the first argument passed to this method must be of type int, but a string is being provided.

To solve this issue, you need to make sure that the value passed as the first argument to File::readableSize() is an integer.

Here are some steps you can follow:

  1. Check the data type of the argument:
    Look at the code in Media.php on line 308 and check what value is being passed as the first argument to File::readableSize(). Ensure that it is an integer.

  2. Convert the argument to an integer if necessary:
    If the argument is a string, you may need to convert it to an integer before passing it to File::readableSize(). You can use the intval() function for this purpose.

    $bytes = intval($yourStringValue);

    Replace $yourStringValue with the actual variable or value that is being passed.

  3. Handle edge cases:
    Ensure that the value being passed to File::readableSize() is always a valid integer. If there are cases where it could be a string, make sure to handle those cases appropriately.

  4. Check for other instances of the method call:
    If the issue persists, check if there are other places in your codebase where File::readableSize() is called and review those calls to ensure that the first argument is always of type int.

Once you have made the necessary adjustments, the error should be resolved. Additionally, you may want to check the documentation or source code of the Plank\Mediable\Helpers\File class to understand the expected input types for the readableSize() method.

from akaunting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.