# External uploads custom metadata

**URL:** <https://forum.elixirforum.com/t/external-uploads-custom-metadata/56370>\
**Category:** Questions\
**Tags:** phoenix, liveview, liveview-upload\
**Created:** [June 8, 2023, 8:26am UTC](https://forum.elixirforum.com/t/external-uploads-custom-metadata/56370 "2023-06-08T08:26:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neophen](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/neophen/32/20004_2.png) [@Neophen](https://forum.elixirforum.com/u/Neophen)\
**Post date:** [June 8, 2023, 8:26am UTC](https://forum.elixirforum.com/t/external-uploads-custom-metadata/56370/1 "2023-06-08T08:26:50Z")

</div>

Is there a way to add custom meta data back to entry after the upload?

```elixir
import { UploadClient } from '@uploadcare/upload-client'

const client = new UploadClient({ publicKey: "publicKey" })

const Uploadcare = (entries, onViewError) => {
    const uploadEntry = makeEntryUploader(onViewError)
    entries.forEach(uploadEntry)
}

const makeEntryUploader = (onViewError) => async (entry) => {
    const onProgress = ({ isComputable, value }) => {
        if (isComputable) {
            let percent = Math.round(value * 100)
            if (percent < 100) { entry.progress(percent) }
        }
    }

    const abortController = new AbortController()
    onViewError(() => abortController.abort())
    const result = await client.uploadFile(entry.file, {
        onProgress,
        signal: abortController.signal,
    })

    // How to add the data to the entry?
    entry.meta = {
        ...entry.meta,
        // This doesn't work:
        uploadcare: result
    }
    entry.progress(100)
}

const uploaders = {
    Uploadcare,
}

export default uploaders

```

I have this in the live view:

```elixir
defp presign_upload(entry, socket) do
    meta = %{uploader: "Uploadcare"}
    {:ok, meta, socket}
end

```

But I only get the url and stuff in the response from the `await client.uploadFile(entry.file, {`

Has anyone ran into this? Do I need move the uploading to the server side to get the required data?

---

<div class="post-metadata">

**Author:** ![Neophen](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/neophen/32/20004_2.png) [@Neophen](https://forum.elixirforum.com/u/Neophen)\
**Post date:** [June 8, 2023, 3:04pm UTC](https://forum.elixirforum.com/t/external-uploads-custom-metadata/56370/2 "2023-06-08T15:04:02Z")

</div>

For anyone else interested this is the current solution i arrived at.  
It’s a hack with the least amount of indirection that i could come up with.

> <https://gist.github.com/Neophen/f90176a17fad823d1957c7245d70beec>
