#Nuxt Strapi Module. File upload

2 messages · Page 1 of 1 (latest)

oblique spokeBOT
#

Hi @wary scaffold. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

I don't see specific information about the Nuxt Strapi module's file upload functionality in the provided knowledge sources. While there are some references to Strapi integration with Nuxt, particularly with Nuxt Image in the Strapi provider documentation, there's no detailed information about file uploads or the error you're encountering.

The error Missing "data" payload in the request body suggests that the API expects a specific format for the request body when uploading files. This could be related to changes in the Strapi API between versions 4 and 5, or changes in how the Nuxt Strapi module handles requests.

From the knowledge sources, I can see that when making POST requests in Nuxt, the content type headers need to be handled differently for FormData:

if (payload instanceof FormData) {
  delete headers["Content-Type"];
} else {
  headers["Content-Type"] = "application/json";
}

However, without specific information about the Nuxt Strapi module's file upload implementation and how it changed between versions, I cannot provide a complete solution to your issue.

I recommend checking the official documentation for the @nuxtjs/strapi module or its GitHub repository for migration guides from version 4 to 5, as this information is not available in the provided knowledge sources.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: