-
Notifications
You must be signed in to change notification settings - Fork 177
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
Proper use of Container Model SDK #650
Comments
Did you get any further? I haven't tried uploading files, but may be doing this shortly. If I do, I'll try to come back here and update it.
|
Hi, sorry for the wait, at the end I couldnt use the integrated methods for upload, so I ended up using native post request to the backend endpoint. ` let formData: FormData = new FormData();
|
What type of issue are you creating?
What version of this module are you using?
Write other if any:
So I've been searching any clue on how to properly use the container model generated for the sdk, I'm using angular 8 to try to upload to my loopback 3 server;
` onFileSelect(event) {
if (event.target.files.length > 0) {
const file = event.target.files[0].name;
const formData = new FormData();
var reader = new FileReader();
formData.append('file ',event.target.files[0]);
// console.log(formData)
for (var [key, value] of formData.entries()) {
console.log(key, value);
}
}`
this is my component.ts
`
this si the html part where the user selects the file and then its supposed to upload it.
I can understand the first parameter on the upload method, but what exactly I'm supposed to put on the request parameter?
I made it work testing the server endpoint with insomnia, as a multipart form and having a parameter called 'file', selecting the file, submitting and it uploaded it perfectly, but now trying with the sdk I cant figure out what Im doing wrong, any idea?
The text was updated successfully, but these errors were encountered: