How to use imagekit.io API to Upload Images

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

see also this example App Inventor Tutorials and Examples: Dropbox | Pura Vida Apps

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

@cedkim Please have a Look on this API.

Can you help me to implement this in Kodular

Friend, the steps are above. It is not an extension. Each API has its parameters. The Component Kodular web block has the POST and GET methods. Try to understand how each works.

Thanks Friend for Reply.

Yes I am Trying.
My Bad Habit everytime I do something and try but it dont work I do Delete all blocks.

If this is Done then we get Unlimited of Media Storage Issue Solved.

Can’t You Help Me, By Showing Block.?

what about YOU showing your blocks, then we can suggest improvements?
Taifun

2 Likes

First, you have to go to this link (client API)
https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload
Then, with the Terminal Extension, try to execute this curl command:

curl -F file=@“YourFilePath” -F publicKey=YourApiKey -F signature=PrivateAPIKey -F expire=ExpireInSeconds -F token=YourToken -F fileName=YourFileName
REMEMBER TO CHANGE THE VALUES WITH YOUR DATA

1 Like

After that ?

Look at the previous post

So first I need to host the client side code. then from there get the parameters then this curl will work ?

You only need the client side I think. The server side is if you want to create your own server (I suppose, I don’t know how ImageKit works :upside_down_face:)

1 Like

to run this I need token. so for getting token i need to host the client side code. Am I Right ?

Let me investigate it for 5 minutes

Ok. I will be thankful if you help me with this.

Ok. The token is a string that you have to generate on the app. It’s like an identifier for each upload or request. So each token can’t be repeated

Yes. token as well as expire too. so how do i generate both ?

Try to generate the token using this:


Here is this api

and how do i generate signature ?

You have to get the text of this page. Each time you enter, it generate a different string
https://www.uuidgenerator.net/api/version1

I figured out to manage token, signature, expiry.

image

now I am getting empty String. @JaviR3TicS