I have embedded my CDF in facebook.The data for the CDF should be taken from facebook server or my server dynamically.I tried out but its not working in dynamic code iam not able to access the data at all from both servers.Now i have the doubt is it possible to access data for the CDF from external databases.

  • $\begingroup$ Take a look at blog about Mathematica Enterprise Edition. image1, image2 $\endgroup$ Dec 30, 2013 at 9:58
  • 1
    $\begingroup$ I think that it is fairly clear that a standalone CDF can Import data (you would need Enterprise Mathematica for DatabaseLink). The relevant part is likely about embedding. Can an embedded CDF access a database given that the plugin is sandboxed? I'm 99.9% sure that it can't, but haven't tested. Enterprise signing will not have any effect at all on the sandboxing here as far as I'm aware. $\endgroup$
    – KAI
    Dec 30, 2013 at 18:27

1 Answer 1


It is possible to access data via Import even in a (nonenterprise) .cdf. It must be a publicly available website (i.e., no login or passwords), and there may be other restrictions. In any case, here is code some that does the import:

imageNames = {"http://www.massmurdermedia.tv/images/TV%20Test%20Pattern%2007.jpg", 
Manipulate[Import[imageNames[[i]]], {i, 1, Length[imageNames], 1, 
      ControlType -> PopupMenu}, SynchronousUpdating -> False, SaveDefinitions -> True]

Copy this and save as .cdf standalone. When you open it, you will be able to read in the two images from the internet (internet connection required). I don't know if this will work embedded in Facebook. If it doesn't then you can be pretty sure that no kind of Importing will work in that context. If it does, then you can just mimic this for the data in your application.

  • $\begingroup$ The above code works when i embed it in Facebook.It imports images from a webpage.But when i take data from database it was protected[Its not a open url].When it was protected it will not take the datas from that[missing the connection string].And i want the data to be dynamic in the sense it should be refreshed and display data from the server as soon as the data in the database was updated.I tried [Dynamic Refresh] and [timer] for auto refresh.both are not working.The CDF getting hanged up in the FB page whenever i use this in the code. $\endgroup$ Dec 31, 2013 at 8:23
  • $\begingroup$ Then if you want to use the .cdf's for this, you are going to have to work the problem from the other end: how can you get the data written into a form and into a location that the .cdf can read? $\endgroup$
    – bill s
    Dec 31, 2013 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.