How to use FILES["source"] value with API

ruslani

New Member
Joined
Jun 9, 2019
Messages
2
Points
1
Can can I use FILES["source"] value in the POST request to upload images from the hard drive (local images) using the API?
No matter how I try to modify the source value, I still get "Invalid base64 string." error message in response.
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
15,457
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
Yes, you can do it. But you have to send the request as a multipart/form-data. Since you aren't sending the request as multipart, the system assumes that the source is a string (base64). You either forge the form or you POST a base64 image.
 

ruslani

New Member
Joined
Jun 9, 2019
Messages
2
Points
1
Hi!
Still can't figure it out.
Here is what I've built in Paw:

2356

And still getting:
2357

Everything works fine if I use an URL with an image, it's just lacal files that are not working.
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
15,457
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com