---
title: "Discussion on \"Editing forms with live_file_input\" | Hashnode"
description: "Discussion on \"Editing forms with live_file_input\". Approaches to edit LiveView forms that use live_file_input"
url: "https://hashnode.com/posts/editing-forms-with-live-file-input/646cd3e1f419f3d1c1b5aaa6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Editing forms with live\_file\_input](https://blog.miguelcoba.com/editing-forms-with-live-file-input?utm_source=hashnode&utm_medium=feed)

Approaches to edit LiveView forms that use live\_file\_input

May 23, 2023 · 16 min read · blog.miguelcoba.com  
Updated May 24, 2023  
Read the article

-   [#elixir](https://hashnode.com/tag/elixir)
-   [#liveview](https://hashnode.com/tag/liveview)
-   [#phoenix-liveview](https://hashnode.com/tag/phoenix-liveview)
-   [#phoenix](https://hashnode.com/tag/phoenix)
-   [#file-upload](https://hashnode.com/tag/file-upload)

## Written by

[Miguel Cobá](https://hashnode.com/@miguelcoba)

@miguelcoba · Barcelona, Spain

  
[View profile](https://hashnode.com/@miguelcoba)

Elixir and Elm programmer. eBook writer

I write about Elixir, Elm, Software Development, and eBook writing.

## Responses

Markdown supported · ⌘↵ to post

[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
```
