Skip to content

[v4] Upload files related to entry is not set the field in content type but file uploaded #11919

@niwasmala

Description

@niwasmala

Bug report

Describe the bug

Unable to set field when upload files related to entry. File is uploaded but the field is not set.

Steps to reproduce the behavior

  1. Create content type person with field name (short text) and avatar (media)
  2. Create new person data with name "John Doe" and empty avatar
  3. Set permission for public to allow upload, find, and find-one
  4. Send http request to upload as mentioned in documentation
  5. See person data
  6. Field avatar is not set

Expected behavior

Person is set with correct avatar.

Screenshots

Content Type Person
image

Set permissions for public to upload
image

CURL api with file
image

File uploaded in media
image

Field avatar is not set
image

Code snippets

CURL used to call api

curl -F "files=@logo.jpg" -F "ref=person" -F "refId=1" -F "field=avatar" http://localhost:1337/api/upload

System

  • Node.js version: 14.18.0
  • NPM version: 7.23.0
  • Strapi version: 4.0.0
  • Database: sqlite
  • Operating system: Windows 10

Additional context

No additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions