System Information
-
Strapi Version: 3.4.5
-
Operating System: unbuntu 18
-
Database: sqlLite
-
Node Version: 14.15.0
-
NPM Version: 6.14.8
-
Yarn Version:
Hello Community I am trying to upload to entry in a collection. When i upload directly to the upload folder I am able to upload the file but when I am trying to upload to an entry I am getting error code 500(internal server error).
const handleSubmit=()=>{
const data=new FormData();
data.append(“ref”,“checkOspiPage”);//model name
data.append(“refId”,postId);//entry id
data.append(“field”,“coverImage”);//field name
data.append(“files”,file,file.name);
if(file!==undefined)
axios.post(url,data).then(res=>console.log(res)).catch(err=>console.log(err));
}
error TypeError: Cannot read property ‘associations’ of undefined
at /var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-connector-bookshelf/lib/relations.js:259:46
at Array.forEach ()
at /var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-connector-bookshelf/lib/relations.js:253:16
at Array.reduce ()
at Function.update [as updateRelations] (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-connector-bookshelf/lib/relations.js:105:68)
From previous event:
at /var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/knex/lib/transaction.js:68:34
at processImmediate (internal/timers.js:461:21)
From previous event:
at new Transaction (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/knex/lib/transaction.js:57:30)
at Client_SQLite3.transaction (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/knex/lib/client.js:114:12)
at Function.transaction (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/knex/lib/util/make-knex.js:40:31)
at wrapTransaction (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-connector-bookshelf/lib/queries.js:51:15)
at create (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-connector-bookshelf/lib/queries.js:118:12)
at Object.create (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-connector-bookshelf/lib/queries.js:56:20)
at fn (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-database/lib/queries/helpers.js:31:54)
at Object.create (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-database/lib/queries/helpers.js:15:24)
at async Object.add (/var/www/html/strapi/angularBlog/jeykll/strapi-jeykll/node_modules/strapi-plugin-upload/services/Upload.js:302:17)
Usually, you get this error when the model’s name is incorrect.
Please check that the model name that you are defining in ref corresponds with the filename of the model, not the name that is defined inside the file.
Model’s filename can’t be camel case, it is kebab case (ex: check-ospi-page.settings.json)

Replace with data.append(“ref”,“check-ospi-page”);
or with your corresponding model filename.
Thanks for the reply @sunnyson. I had tried that also it didn’t work at last when I updated my strapi pack to latest version v 3.5.4 it worked.