Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload plugin examples not clear, should have better non react examples #1379

Closed
Tracked by #1948
jagyandeep opened this issue Nov 20, 2022 · 3 comments
Closed
Tracked by #1948
Assignees
Labels
issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io

Comments

@jagyandeep
Copy link

jagyandeep commented Nov 20, 2022

edit by @derrickmehaffy Transfer to docs team to improve the upload plugin examples (I might be able to submit a PR myself sometime soon)


Bug report

Required System information

  • Node.js version: v14.15.3
  • NPM version: 6.14.9
  • Strapi version: 4.5.1
  • Database: Postgres
  • Operating system: Windows 10

Describe the bug

unable to uploadimage file using upload api with 'field' value.

Steps to reproduce the behavior

  1. Open Postman
  2. Select POST method
  3. Set request body type to form-data
  4. Set required fields (files, refId, ref, field)
  5. Hit send and check console output

Expected behavior

Image should be uploaded and link set to respective content type.

Screenshots

image
image

Code snippets

If applicable, add code samples to help explain your problem.

Additional context

If 'field' value is not set in postman, the image is successfully uploaded to media library.

@derrickmehaffy
Copy link
Member

I think I see the issue in your request, for your ref you are using a colon where you need a period api::activity:activity instead of api::activity.activity

See my example below:

image

I will however say our docs are not great at laying out exactly what is needed here and how it should be formatted. Just as a tip for you to find the UID you can use the following CLI to get all the UIDs for your content-types: yarn strapi content-types:list or npm run strapi content-types:list

image

@derrickmehaffy
Copy link
Member

I'm going to transfer this issue over to our docs repo so we can work on improving the upload plugin docs to not just include react code examples but actually properly explain all the options and some example values for them in something like postman or thunder client

@derrickmehaffy derrickmehaffy changed the title Unable to upload image via upload api with 'field' value Upload plugin examples not clear, should have better non react examples Dec 28, 2022
@derrickmehaffy derrickmehaffy transferred this issue from strapi/strapi Dec 28, 2022
@stb13579 stb13579 self-assigned this Dec 29, 2022
@pwizla pwizla assigned pwizla and unassigned stb13579 Oct 25, 2023
@pwizla pwizla added the issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io label Oct 25, 2023
@pwizla
Copy link
Collaborator

pwizla commented Dec 11, 2023

Hi,
Thanks for reporting. I'm closing this issue but it's included in the meta issue for the Upload plugin (#1948).

@pwizla pwizla closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io
Projects
None yet
Development

No branches or pull requests

4 participants