-
Notifications
You must be signed in to change notification settings - Fork 723
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
File upload field #541
Comments
Currently the file is uploaded once selected, and then you retrieve its name from the upload API. IMO, it is a wrong behavior, and we should upload it only when the form is submitted. It is especially wrong if you have heavy treatment on uploaded files, like video encoding. But then, JSON API may not work with a Not sure about the implications. @karantan, have you successfully dealt with it? |
@jpetitcolas Yes I have solved this by creating a simple directive. But it works only when object (e.g. user) gets updated... atm this is not priority and will come back later when other things are working... Here is what I did:
and directive template:
So when I select files I know its not a nice solution but it works :) |
hi @karantan any solution for this? the problem with enctype form. |
@hmendes00 I haven't been following ng-admin for some time now so I can't tell you if there is a better solution now. The above fix will definitely work. |
The current version of the file upload is inapplicable IMO. You can use it only when updating the data object (e.g. user) because it doesn't work when on submit.
There are 2 problems. 1. the form doesn't have "enctype=multipart/form-data" and 2. when you submit the form the data gets serialized. At least I am very certain it does. Didn't investigate this too much.
I have created my own hard-coded/hacked version of this file upload but it is not ready to be packed into the ng-admin...
Is there any interest in adding this field or is this too advance and is OK that programmer must code this manually?
The text was updated successfully, but these errors were encountered: