Message Boards Message Boards

0
|
4537 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Problem Storing Image In DataBin from FormFunction

Posted 9 years ago

I have an issue being able to store an image in a DataBin when called from a CloudDeployed FormFunction

All character and value entries can be stored but the image will not store. The same code when called from the desktop has no issues storing images. Is there a work around or some permissions that need to be set. I have set the access permissions for the Databin to be public and all Permissions of the cloud deployed object are also public.

Some example code is given below:

CloudDeploy[
 FormFunction[{"image" -> <|"Interpreter" -> "Image", 
     "Label" -> "Fruit Image"|>, 
   "value" -> <|"Interpreter" -> "Number", "Label" -> "Amount"|>, 
   "day" -> <|"Interpreter" -> Range[1, 31, 1], "Label" -> "Day", 
     "Input" -> ToString[ DateList[Today][[3]]]|>,
   "month" -> <|"Interpreter" -> Range[1, 12, 1], "Label" -> "Month", 
     "Input" -> ToString[ DateList[Today][[2]]]|>,
   "year" -> <|
     "Interpreter" -> {ToString[ DateList[Today][[1]] - 1] -> 
        DateList[Today][[1]] - 1, 
       ToString[ DateList[Today][[1]]] -> DateList[Today][[1]]}, 
     "Label" -> "Year", "Control" -> RadioButtonBar, 
     "Input" -> ToString[DateList[Today][[1]]]|>,
   "fruit" -> <|
     "Interpreter" -> {"Apples" -> "Apples", "Pears" -> "Pears", 
       "Other" -> "Other"}, "Label" -> "Pick Your Fruit", 
     "Control" -> RadioButtonBar, "Input" -> "Other"|>}, 
  Module[{recieptLabel, outputImage, processedImage, dateString, 
     fileID, dateList , dataBinID = "blah" , id, dataBinData, 
     dataBinPointer, binReturn, imageTag},
    dateList = {ToExpression[#year], ToExpression[#month], 
      ToExpression[#day]};
    id = ToExpression[
       Databin["someDataBinID"]["Latest"]["Data"]["fruitid"]] + 1;
    Databin["dataBinID"][
     "Add", <|"fruitid" -> ToString[id], "fruit" -> #fruit, 
      "Date" -> DateList[dateList], "OutputImage" -> #image, 
      "amount" -> #value|>];
    (*Return[outputImage]*)
    Return["Fruit Added :)"]] &, "HTML", 
  AppearanceRules -> {"Title" -> "Pick Your Own Fruit"}], 
 Permissions -> "Public"]

I have received some feedback from Wolfram Technical Support. They are in the process of fixing this:

Hi Christopher,

Thank you for your email

It seems the problem here is with uploading images. Since both cloud and datadrop are relatively new features, some connections between cloud and datadrop do not function as expected. I have now reported this problem to our developers and hope it gets fixed soon. Thanks

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract