<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="211270" data-post-id="211270">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I changed for this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def changeset(desk, attrs) do
    desk
    |&gt; cast(attrs, [:name, :photo_urls])
    |&gt; validate_empty_photo_urls()
    |&gt; validate_required([:name])
  end

  def validate_empty_photo_urls(changeset)  do
    photos = get_field(changeset, :photo_urls)

      if (photos == []) do
        put_change(changeset, :photo_urls, "must insert a photo!")
      else
        changeset
      end
  end
</code></pre>
<p>And when I try i can know receive an <code>Ecto.ChangeError</code>  on the log and stop to submit and not save the data.<br>
The log when I try is this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[error] GenServer #PID&lt;0.671.0&gt; terminating
** (Ecto.ChangeError) value `"must insert a photo!"` for `LiveViewStudio.Desks.Desk.photo_urls` in `insert` does not match type {:array, :string}
    (ecto 3.5.6) lib/ecto/repo/schema.ex:889: Ecto.Repo.Schema.dump_field!/6
    (ecto 3.5.6) lib/ecto/repo/schema.ex:898: anonymous fn/6 in Ecto.Repo.Schema.dump_fields!/5
    (stdlib 3.14) maps.erl:233: :maps.fold_1/3
    (ecto 3.5.6) lib/ecto/repo/schema.ex:896: Ecto.Repo.Schema.dump_fields!/5
    (ecto 3.5.6) lib/ecto/repo/schema.ex:829: Ecto.Repo.Schema.dump_changes!/6
    (ecto 3.5.6) lib/ecto/repo/schema.ex:255: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
    (live_view_studio 0.1.0) lib/live_view_studio/desks.ex:55: LiveViewStudio.Desks.create_desk/3
    (live_view_studio 0.1.0) lib/live_view_studio_web/live/desks_live.ex:46: LiveViewStudioWeb.DesksLive.handle_event/3
    (phoenix_live_view 0.15.4) lib/phoenix_live_view/channel.ex:338: anonymous fn/3 in Phoenix.LiveView.Channel.view_handle_event/3
    (telemetry 0.4.2) /Users/romenigld/workspace/phoenix/phoenix_live_view/pragprog/my_code/live-view-studio/deps/telemetry/src/telemetry.erl:262: :telemetry.span/3
    (phoenix_live_view 0.15.4) lib/phoenix_live_view/channel.ex:203: Phoenix.LiveView.Channel.handle_info/2
    (stdlib 3.14) gen_server.erl:689: :gen_server.try_dispatch/4
    (stdlib 3.14) gen_server.erl:765: :gen_server.handle_msg/6
    (stdlib 3.14) proc_lib.erl:236: :proc_lib.wake_up/3
Last message: %Phoenix.Socket.Message{event: "event", join_ref: "30", payload: %{"event" =&gt; "save", "type" =&gt; "form", "value" =&gt; "_csrf_token=MhYKJTM6IjQPJg0SCC0_Yz5REx91BwcaZlrjvbpbGNIzCky6k0dp402q&amp;desk%5Bname%5D=testing"}, ref: "44", topic: "lv:phx-FnfspaamCei_owGE"}
State: %{components: {%{}, %{}, 1}, join_ref: "30", serializer: Phoenix.Socket.V2.JSONSerializer, socket: #Phoenix.LiveView.Socket&lt;assigns: %{changeset: #Ecto.Changeset&lt;action: :insert, changes: %{name: "testing", photo_urls: "must insert a photo!"}, errors: [], data: #LiveViewStudio.Desks.Desk&lt;&gt;, valid?: true&gt;, desks: [], flash: %{}, live_action: nil, uploads: %{__phoenix_refs_to_names__: %{"phx-Fnfs0wpIbWDZCwDB" =&gt; :photo}, photo: #Phoenix.LiveView.UploadConfig&lt;...&gt;}}, changed: %{}, endpoint: LiveViewStudioWeb.Endpoint, id: "phx-FnfspaamCei_owGE", parent_pid: nil, root_pid: #PID&lt;0.671.0&gt;, router: LiveViewStudioWeb.Router, view: LiveViewStudioWeb.DesksLive, ...&gt;, topic: "lv:phx-FnfspaamCei_owGE", transport_pid: #PID&lt;0.660.0&gt;, upload_names: %{}, upload_pids: %{}}
[debug] QUERY OK source="desks" db=1.9ms idle=1616.9ms
SELECT d0."id", d0."name", d0."photo_urls", d0."inserted_at", d0."updated_at" FROM "desks" AS d0 ORDER BY d0."id" DESC []

Know just need to insert the message on errors.
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211270" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-211270" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211270"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="211271" data-post-id="211271">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sfusato" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sfusato/120/11569_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sfusato
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You were on the right track with the previous iteration.</p>
<p>The 2nd iteration makes no sense, honestly.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211271" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-211271" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211271"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="211273" data-post-id="211273">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yes I notice I forget to add the <code>[photo_urls: "must insert a photo!"]</code>.<br>
I will stop now because I need to go out.<br>
I will try this later.<br>
Can you see the other solution I tried?<br>
what do you think?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211273" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-211273" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211273"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="211274" data-post-id="211274">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So what I do now for show the error like the <code>error_to_string</code> function?</p>
<p><code>error_to_string(Ecto.ChangeError)</code>?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211274" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-211274" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211274"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="211276" data-post-id="211276">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sfusato" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sfusato/120/11569_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sfusato
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You started from this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def validate_empty_photo_urls(changeset, field)  do
    validate_change(changeset, field, fn _field, value -&gt;
      cond do
        is_nil(value) -&gt; "must insert a photo!"
      end
    end)
  end
</code></pre>
<p>which was quite close. The <a href="https://hexdocs.pm/ecto/Ecto.Changeset.html#validate_change/3" rel="noopener nofollow ugc">docs</a> have this to say:</p>
<blockquote>
<p>It invokes the <code>validator</code> function to perform the validation only if a change for the given <code>field</code> exists and the change value is not <code>nil</code>. The function must return a list of errors (with an empty list meaning no errors).</p>
</blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def validate_empty_photo_urls(changeset, field)  do
    validate_change(changeset, field, fn _field, value -&gt;
      if Enum.empty?(value) do
        [photo_urls: "must insert a photo!"]
      else
        []
      end
    end)
  end
</code></pre>
<p>It basically has the modifications in the bullet points I’ve mentioned previously. I haven’t tested this, so make sure you do.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211276" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-211276" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211276"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="211277" data-post-id="211277">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I will try, thank’s for reply <a class="mention" href="/u/sfusato" rel="nofollow">@sfusato</a> !</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211277" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-211277" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211277"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="211279" data-post-id="211279">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>They are inserting into database like before.<br>
and I tried to use the function <code>add_error()</code> like:</p>
<p><code> add_error(changeset, :photo_urls, "must insert a photo!")</code></p>
<p>but not work.</p>
<p>The most close was when it raises the <code>Ecto.ChangeError</code>.  But this is not the correct way to do.<br>
I get this idea here on <a href="https://elixirschool.com/es/lessons/ecto/changesets/" rel="noopener nofollow ugc">Changeset - Elixir School</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211279" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-211279" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211279"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="211281" data-post-id="211281">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sfusato" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sfusato/120/11569_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sfusato
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh, right, since there was no change, my validator wasn’t actually called either since there’s no point in validating.</p>
<p>Let’s see. Remove the default value of the field:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">field :photo_urls, {:array, :string}
</code></pre>
<p>Add the field to <code>validate_required</code>:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">|&gt; validate_required([:name, :photo_urls])
</code></pre>
<p>And let’s use it in combination with <a href="https://hexdocs.pm/ecto/Ecto.Changeset.html#validate_length/3" rel="noopener nofollow ugc"><code>validate_length</code></a> with a min of 1:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">|&gt; validate_length(:photo_urls, min: 1)
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211281" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-211281" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211281"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="211311" data-post-id="211311">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>When I arrived in home I was thinking in to  inspect the values.<br>
So I do this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule LiveViewStudio.Desks.Desk do
  use Ecto.Schema
  import Ecto.Changeset

  schema "desks" do
    field :name, :string
    field :photo_urls, {:array, :string}, default: []

    timestamps()
  end

  @doc false
  def changeset(desk, attrs) do
    desk
    |&gt; cast(attrs, [:name, :photo_urls])
    |&gt; validate_required([:name])
    |&gt; validate_empty_photo_urls()
  end

  def validate_empty_photo_urls(changeset)  do
    photos = get_field(changeset, :photo_urls)

    IO.inspect(photos, label: "Photos")

    if Enum.empty?(photos) do
      changeset = add_error(changeset, :photo_urls, "must insert a photo!")
      IO.inspect(changeset, label: "changeset")
    else
      changeset
    end
  end
end
</code></pre>
<p>So in the log shows me this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Photos: []
changeset: #Ecto.Changeset&lt;
  action: nil,
  changes: %{name: "test"},
  errors: [photo_urls: {"must insert a photo!", []}],
  data: #LiveViewStudio.Desks.Desk&lt;&gt;,
  valid?: false
</code></pre>
<p>And I can see it was working the validations and it wasn’t inserted in the database when I click on the button Upload.<br>
So I was seeking why not it was showed the error and the thing is not having the <code>error_tag</code> for the <code>:photo-urls</code>.</p>
<p>So I add the error_tag on the beginning of the drag-and-drop div:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  &lt;div class="drop" phx-drop-target="&lt;%= @uploads.photo.ref %&gt;"&gt;
      &lt;div&gt;
        &lt;%= error_tag f, :photo_urls %&gt;
        &lt;img src="/images/upload.svg"&gt;
        &lt;div&gt;
          &lt;label for="&lt;%= @uploads.photo.ref %&gt;"&gt;
            &lt;span&gt;Upload a file&lt;/span&gt;
            &lt;%= live_file_input @uploads.photo, class: "sr-only" %&gt;
          &lt;/label&gt;
          &lt;span&gt;or drag and drop&lt;/span&gt;
        &lt;/div&gt;
        &lt;p&gt;
          &lt;%= @uploads.photo.max_entries %&gt; photos max,
          up to &lt;%= trunc(@uploads.photo.max_file_size / 1_000_000) %&gt; MB each
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
</code></pre>
<p>And now it’s working! <img src="https://forum.elixirforum.com/images/emoji/apple/laughing.png?v=15" title=":laughing:" class="emoji" alt=":laughing:" loading="lazy" width="20" height="20"><br>
Thank you for the help guys, it was very helpful!<br>
</p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/4/6/4677b5f72d857cdec74a60affec075906f47f321.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/4677b5f72d857cdec74a60affec075906f47f321" title="Captura de Tela 2021-04-21 às 22.10.16" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/4/6/4677b5f72d857cdec74a60affec075906f47f321_2_690x439.jpeg" alt="Captura de Tela 2021-04-21 às 22.10.16" data-base62-sha1="a3nTVQ74Jknyzrq3ZswIzYf5bsB" width="690" height="439" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/4/6/4677b5f72d857cdec74a60affec075906f47f321_2_690x439.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/4/6/4677b5f72d857cdec74a60affec075906f47f321_2_1035x658.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/4/6/4677b5f72d857cdec74a60affec075906f47f321_2_1380x878.jpeg 2x" data-dominant-color="D5D5DA"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Captura de Tela 2021-04-21 às 22.10.16</span><span class="informations">2784×1774 155 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211311" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-211311" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211311"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="211323" data-post-id="211323">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="romenigld" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/romenigld/120/6200_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  romenigld
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tried now this and don’t works.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="211323" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-validate-an-array-of-strings-for-the-upload-files-in-phoenix-liveview/39079/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-211323" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="211323"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/39079/load_more?page=3">Load more posts (6 remaining)</a>
</div></template></turbo-stream>