Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Image upload failed with Rich Editor in 2.8

ligyxyligyxy New
edited February 2019 in Vanilla 2.0 - 2.8

Tried to upload image or attachment through new Rich Editor. It returns "Request failed with status code 400" while I can see the file in uploads folder.


I have tried update the folder permissions but it doesn't help.

Comments

  • Options

    By checking the network, looks like the POST requests to /api/v2/media failed, and it got

    {

      "message": "Validation Failed",

      "status": 400,

      "errors": [

        {

          "field": "storageMethod",

          "code": "ValidateRequired",

          "status": 400,

          "message": "ValidateRequired."

        }

      ]

    }

  • Options

    Since it mentions storageMethod is required, I eventually fixed it by giving GDN_Media.StorageMethod a default value 'local' in MySQL. But should this be in upgrade process?

  • Options
    LincLinc Detroit Admin

    Did you run utility/update after you updated your files?

  • Options
    LincLinc Detroit Admin
    edited February 2019

    I'm looking at our commit history, and we removed the column `GDN_Media.StorageMethod` in Dec 2015. I removed the column from my localhost (which predates the column removal, and did have the default set to `local`) and am able to use the image drag-and-drop upload without issue.

    Don't have any idea why that happened, sorry.

  • Options

    I did run utility/update before seeing this issue. I thought it handles the database migration but looks like GDN_Media.StorageMethod is somehow not covered.

  • Options
    LincLinc Detroit Admin

    As I said, it wouldn't be covered because it's no longer used and was removed from the table structure some years ago.

  • Options

    Hi, I'm having the same problem I think, could you explain me better how you fixed it?

    Thank you a lot!

  • Options
    ligyxyligyxy New
    edited April 2019

    I kept the StorageMethod column in GDN_Media, but set the default value as "local". Just one mysql alert query.

Sign In or Register to comment.