danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

Handle initial model value? #1985

Open simondrabble opened 7 years ago

simondrabble commented 7 years ago

Is it possible to handle the initial value of a model as if ngf-change() was called? Consider:

  1. Load the model's value (an image URL) from remote server.
  2. ...
  3. Now the form's $file value is set to (a blob/ the image data).

I have the following situation. A remote server requires that the image is re-posted when an update is made to other unrelated fields (yes, it's a bad API.. not under my control). In order for this to happen without requiring the user re-select (possibly) the same image again, I'd like the POSTed request to hold the image data just as if a new image had been selected, and the ngf-change() handler fired.

Is this possible?