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.
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 and 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.
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?
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!