---
title: "Comment by Yosua Wijaya on \"Editing forms with live_file_input\" | Hashnode"
description: "For anyone who is looking for a way to change the :uploads assigns to set the max_entries property, we can use Map.put to update the entire assigns socket on ma"
url: "https://hashnode.com/posts/editing-forms-with-live-file-input/646cd3e1f419f3d1c1b5aaa6/comment/674eee15e4d3529f6bf3ae16"
---

[Discussion](https://hashnode.com/posts/editing-forms-with-live-file-input/646cd3e1f419f3d1c1b5aaa6)

Comment [Editing forms with live\_file\_input](https://hashnode.com/posts/editing-forms-with-live-file-input/646cd3e1f419f3d1c1b5aaa6)

[Yosua Wijaya](https://hashnode.com/@yosuaw)

[Dec 3, 2024](https://hashnode.com/posts/editing-forms-with-live-file-input/646cd3e1f419f3d1c1b5aaa6/comment/674eee15e4d3529f6bf3ae16)

For anyone who is looking for a way to change the `:uploads` assigns to set the `max_entries` property, we can use `Map.put` to update the entire assigns socket on `maybe_update_upload_config/2`, something like this:

```
defp maybe_update_upload_config(socket, max_entries) do
    config = Map.get(socket.assigns.uploads, :images)
    new_uploads =
      Map.put(socket.assigns.uploads, :images, %{config | max_entries: max_entries})
    new_assign = Map.put(socket.assigns, :uploads, new_uploads)

    Map.put(socket, :assigns, new_assign)
  end
```
