PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 10:02 PM

delete file from a variable

  • asad

    26 days ago

    i have a file input with multiple attributes. on change i set a variable "files" to even.target -> get.files. it works fine. i have a dive that repeats the "files" with button "delete" . i want to remove the file that is clicked from the "files" variable. how do i do it
  • Tod

    26 days ago

    Great energy @asad! Your continuous contribution to the toddle Community just made you advance to Community Level 8!
  • Lucas G

    26 days ago

    Filter the file index
  • asad

    26 days ago

    i cannot seem to get it working
  • can you demonstrate
  • /attachments/1307084636257779722/1307100617927561319/image.png

    Lucas G

    26 days ago

    image.png
  • @Lucas G
    /attachments/1307084636257779722/1307106982611914782/image.png

    asad

    25 days ago

    the problem is the files are not saved as arrays
    image.png
  • Lucas G

    25 days ago

    You're right in that it is not technically an array
  • fileList is 'array-like'
  • You can use Entries to make it an array
  • image.png
  • Lucas G

    25 days ago

    Also, be mindful that the way you're creating previews can lead to memory leaks
  • You'll want to update it to properly handle it
  • asad

    25 days ago

    i didn't get you . can you explain it a bit more if you don't mind
  • Lucas G

    25 days ago

    Your custom action, it will likely cause memory leaks

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.