Newbie - How do I set up a form so that it has an image upload?

Hi

Sorry but this is a n00b question but i can’t seem to find the documentation for this. I am trying to set up a form that can do image upload for ImageIdentify. The example, I saw was

CloudDeploy[FormFunction[{"size" -> "Number"}, Style["Hello World", Red, #size] &, "GIF"]]

Instead of Hello World, how can I change it so that it is an image and I can set a zoom size or something of that nature? I am just trying to learn the wolfram language by example.

Pointing to some documentation that is specific to this would be very helpful. Thanks

It’s hard to point at a specific piece of documentation to solve our problem. Here’s the code you’re looking for:

CloudDeploy[
 FormFunction[{"size" -> "Number", "image" -> "Image"}, 
  ImageResize[#image, #size] &, "GIF"]]

You can change the size of an image using the ImageResize function. To find that, you shave to search the documentation and learn a bit about how image processing works in Mathematica.

“Number” and “Image” are “Interpreter types”. See the documentation of Interpreter for more examples. These “Interpreter Types” can be used as inputs to a form function. There are many of them.

Thank you, that is very helpful, I have tried it with the new ImageIdentify function -

CloudDeploy[
    FormFunction[{"image" -> "Image"},
        ImageIdentify[#image]&,"PNG"]] 

It works, it is pretty cool. I then tried switching it to an API, which also worked. thanks for the help.

Also see this for a full example using APIFunction

http://community.wolfram.com/groups/-/m/t/537621