strongloop / loopback-component-storage

Storage component for LoopBack.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

upload from Model SDK (Angular)

furkansuv opened this issue · comments

Description/Steps to reproduce

I'm trying to upload attachement from Angular APP via Loopback SDK Model. Uploading from Postman it's working fine.

Loopback version:
├── @mean-expert/loopback-sdk-builder@2.3.1
├── loopback@3.25.1
├── loopback-boot@2.28.0
├── loopback-component-explorer@6.3.1
├── loopback-component-storage@3.6.1
├── loopback-connector-mssql@3.3.0
├── loopback-connector-mysql@5.4.0

Setups:

Server Model:

Attachement.json:
{
"name": "attachment",
"plural": "attachments",
"base": "Model",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}

App Source:

test.component.html
`<form [formGroup]="form" (ngSubmit)="onSubmit()">

`

test.component.ts
constructor(
private _attachement:AttachmentApi
) { }

//Create form
form(mitglied: Mitglied) {
form = this.fs.group({
'file': ['']
})
}

//send to loopback server
onSubmit(){
this._attachement.upload('demo', this.form.value.file)
.toPromise()
.then(res => {console.log(res)} )
}

Once I submit the form, on Google Chrome Dev tools Network shows the upload "pending" and after 4 Minutes it fails:
Bildschirmfoto 2019-06-19 um 20 59 54

Could you please help me?

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.