I am interested in creating an interactive dynamic on a webpage where I will create a Manipulate
window that will accept a user's image input on a website. Can this be done with CDF? If so, how? Thank you!
-
1$\begingroup$ Not an answer, but CDF files can no longer be reliably embedded in web pages because all browsers have either dropped plugin support already, or will drop it before the end of the year. You can use Wolfram Cloud as an alternative (and people can upload images), but it is not a free service. $\endgroup$– SzabolcsApr 11, 2017 at 18:01
1 Answer
As far as I'm concerned the only viable option is to create FormFunction
which can upload a file, then it need to create a cdf/manipulate based on that file input, deploy it and redirect to that deployed cdf.
Here's a small example:
CloudDeploy[
FormFunction[
{"x" -> "Image"}
, HTTPRedirect @ With[
{img = #x}
, CloudDeploy[ Manipulate[Binarize[img, t], {t, 0, 1}] ]
] &
]
]
The problem is that it is detached from the importing interface. You can add a button to redirect to the original form using this trick: Cloud CDF and HTTPRedirect
Using this trick you could also prompt a file uploading dialog but I don't see any way to handle this file and link it to variables in Manipulate.