# Image upload via API in File-Field

**URL:** https://community.baserow.io/t/image-upload-via-api-in-file-field/50
**Category:** Technical Help
**Created:** [October 15, 2021, 9:26pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50 "2021-10-15T21:26:46Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Sebastian](https://community.baserow.io/user_avatar/community.baserow.io/sebastian/32/39_2.png) [@Sebastian](https://community.baserow.io/u/Sebastian)
#### Post date: [October 15, 2021, 9:26pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/1 "2021-10-15T21:26:47Z")

</div>

Hi community,

id like to upload images to my database via API. Unfortunately, I always get an error as soon as I want to upload a new image that is not yet in my database.

**Error message**  
The user file name is invalid

**My code**

> $data = ‘{  
> “image”:[{  
> }, “url”: “[https://www.digital-sales.de/wp-content/uploads/2014/05/Tu-es-einfach-Just-do-it1.jpg](https://www.digital-sales.de/wp-content/uploads/2014/05/Tu-es-einfach-Just-do-it1.jpg)”,  
> “name”: “Do-it-simply-Just-do-it1.jpg”  
> }]  
> }’;

**Field type**  
File

What am I doing wrong?  
Thanks in advance

---

<div class="post-metadata">

### Author: ![bram](https://community.baserow.io/letter_avatar_proxy/v4/letter/b/9d8465/32.png) [@bram](https://community.baserow.io/u/bram)
#### Post date: [October 18, 2021, 8:40am UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/2 "2021-10-18T08:40:54Z")

</div>

Hi Sebastian, welcome to the Baserow community. Judging from the example code that you have provided, I think you’re trying to upload an image directly when updating/creating a row? This is unfortunately not possible. You must first upload your file, to the user files and after that it can be used in row. You might want to take a look at the documentation of these endpoints [https://api.baserow.io/api/redoc/#operation/upload\_file](https://api.baserow.io/api/redoc/#operation/upload_file) and [https://api.baserow.io/api/redoc/#operation/upload\_via\_url](https://api.baserow.io/api/redoc/#operation/upload_via_url). They describe how you can upload from disk or from a URL.

The `name` that’s in the response of user file endpoints, is that `name` that you can use when you want to update the file field value of a row. A small downside is that you can only upload files via the JWT authentication at this point. That means you can’t use token that you generated via the web-frontend for this. This is going to be changed in the future.

---

<div class="post-metadata">

### Author: ![Sebastian](https://community.baserow.io/user_avatar/community.baserow.io/sebastian/32/39_2.png) [@Sebastian](https://community.baserow.io/u/Sebastian)
#### Post date: [October 20, 2021, 8:39pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/3 "2021-10-20T20:39:18Z")

</div>

Hi Bram,

thank you very much for the helpful answer. You already got it right, I wanted to upload the image directly (that would also make the process a bit less complicated from my point of view). Anyway, got it running through your helpful links.

I do have one question though: is there a way to view all the files already uploaded in one place?

Thanks a lot and greetings

---

<div class="post-metadata">

### Author: ![bram](https://community.baserow.io/letter_avatar_proxy/v4/letter/b/9d8465/32.png) [@bram](https://community.baserow.io/u/bram)
#### Post date: [October 21, 2021, 7:36pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/4 "2021-10-21T19:36:02Z")

</div>

Glad to hear that it worked for you. It’s unfortunately not possible to view all the files that you have uploaded.

---

<div class="post-metadata">

### Author: ![mahmouds12](https://community.baserow.io/letter_avatar_proxy/v4/letter/m/b5ac83/32.png) [@mahmouds12](https://community.baserow.io/u/mahmouds12)
#### Post date: [August 15, 2022, 8:24pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/5 "2022-08-15T20:24:06Z")

</div>

Hi @bram any news about using the api token generated from the web-frontend?  
also is there a way I can upload multiple files at once?

---

<div class="post-metadata">

### Author: ![bram](https://community.baserow.io/letter_avatar_proxy/v4/letter/b/9d8465/32.png) [@bram](https://community.baserow.io/u/bram)
#### Post date: [August 16, 2022, 8:08am UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/6 "2022-08-16T08:08:08Z")

</div>

@mahmouds12 We expect to release this functionality in 1.12 (upcoming release). You can track the progress here: [Add user file upload docs to the generated API docs (#255) · Issues · Bram Wiepjes / baserow · GitLab](https://gitlab.com/bramw/baserow/-/issues/255).

---

<div class="post-metadata">

### Author: ![bram](https://community.baserow.io/letter_avatar_proxy/v4/letter/b/9d8465/32.png) [@bram](https://community.baserow.io/u/bram)
#### Post date: [August 16, 2022, 8:09am UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/7 "2022-08-16T08:09:00Z")

</div>

It’s not possible to upload multiple files via one single API request. You can upload multiple by creating multiple simultaneous API requests though.

---

<div class="post-metadata">

### Author: ![allene-copilot](https://community.baserow.io/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@allene-copilot](https://community.baserow.io/u/allene-copilot)
#### Post date: [December 14, 2022, 4:34pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/8 "2022-12-14T16:34:30Z")

</div>

Hey @bram - just started playing around with the product, it’s fantastic.

I have a bunch of S3 URLs in a URL field. I tried duplicating and converting the field type to File, but it doesn’t automatically upload the URLs, which is fine (although this functionality would be awesome).

Is the best way to automate uploads via URL to upload these URLs via API calls, or is there another method you suggest? Thanks!

---

<div class="post-metadata">

### Author: ![bram](https://community.baserow.io/letter_avatar_proxy/v4/letter/b/9d8465/32.png) [@bram](https://community.baserow.io/u/bram)
#### Post date: [December 15, 2022, 2:04pm UTC](https://community.baserow.io/t/image-upload-via-api-in-file-field/50/9 "2022-12-15T14:04:01Z")

</div>

Hi @allene-copilot, I would recommend uploading them manually via the API and update the related row for now. We already have an issue on the backlog related to the described functionality. You can track the progress here: [Convert image URLs into image files (#1216) · Issues · Bram Wiepjes / baserow · GitLab](https://gitlab.com/bramw/baserow/-/issues/1216).
