You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just found small problem with file upload and existing model updates, which is sent with PUT request.
Looks like FormData with files need to passed with POST method only, PUT will send only filename and not the file body :( And according to SO discussions its a browsers (or standarts) limitation.
Forcing m.save(null, {method: 'POST'}) will send all data, just need to check model id on server to distinguish create/update.
Hope this will help somebody in future :)
The text was updated successfully, but these errors were encountered:
Hello!
Just found small problem with file upload and existing model updates, which is sent with PUT request.
Looks like FormData with files need to passed with POST method only, PUT will send only filename and not the file body :( And according to SO discussions its a browsers (or standarts) limitation.
Forcing m.save(null, {method: 'POST'}) will send all data, just need to check model id on server to distinguish create/update.
Hope this will help somebody in future :)
The text was updated successfully, but these errors were encountered: