We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Technique to save diagram to user's local drive

Thread ID:

Created:

Updated:

Platform:

Replies:

116274 May 7,2014 05:52 PM May 13,2014 07:52 AM ASP.NET MVC (Classic) 5
loading
Tags: Diagram
Jeff
Asked On May 7, 2014 05:52 PM

It appears that the DiagramModel.Save method is able to save a diagram's XML to the machine on which the application is running. That is all I have seen, in the samples I have found so far.

In my case, the application will be running on a web server.  Is there a technique by which the diagram's XML can be saved to an individual user's local drive?


Shyam G [Syncfusion]
Replied On May 8, 2014 09:01 AM

Hi Jeff,

We are currently working on your requirement. We will update you the status on 5/12/2014.

Please let me know if any concerns.

Regards,

Shyam G


Jeff
Replied On May 8, 2014 10:31 AM

Thank you, Shyam.  

If there is no easy solution with existing functionality, here is what I would suggest for a future feature:

  1. A DiagramModel method that returns the model XML as a string.  That way, I can do whatever I like with the XML. 
  2. A DiagramModel method to which I can supply the XML as a string.  This could be an overload of the DiagramModel.Load method, or a new DiagramModel method.

With the two methods I describe above, one that sets the XML string for, and one that gets the XML string from, the DiagramModel, I have ultimately flexibility.  I can save and load the XML to/from a local file on the user's system, a blob in Azure Storage, a database column, etc.


Shyam G [Syncfusion]
Replied On May 9, 2014 09:07 AM

 

Hi Jeff,

Diagram is serialized using DiagramModel.Save method, it take file name with full path as its argument as shown in the following code snippet.

Code Snippet:

diagramView.Model.Save(“D:\\filepath\fileName.xml”);

Once this function is executed, a diagram will be serialized and stored in the given file path. Later you can read this file in application level for further processing.       

Currently we don’t have support to get serialized object as a string. We have considered this as feature requestOption to get the serialized diagram as a string , and we have created an incident 124771 however to access this, we request you to login to your direct Trac account to view this incident for more details. 

Our Direct Trac support system can be accessed from the following link: 

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Please let me know if any concerns. 

Regards,

Shyam G


Jeff
Replied On May 9, 2014 12:07 PM

Thank you for your efforts, and for creating the incident related to a feature request.  My comments re: the "option to get the serialized diagram as a string" are a suggestion for future feature improvements.

 

However, my immediate need is to write, and then read, a diagram's XML file to/from a location other than the server's file system.  Since my application will be hosted with a PaaS provider, there is no file space for me to write to except the file space of the application itself.  As you can imagine, that space is very limited. 

 

Is the only option to use DiagramModel.Save and DiagramModel.Load, to write to and then read from the server's file system?


Shyam G [Syncfusion]
Replied On May 13, 2014 07:52 AM

Hi Jeff

Thanks for the update.

We have two option to use DiagramModel.Load and DiagramModel.Save method. One is XML file and another is MemoryStream.

Using XML File:

DiagramModel.Save and DiagramModel.Load methods allows you to save to and then load from the server file system.

Using MemoryStream:

DiagramModel.Save and DiagramModel.Load methods allows you to save to and then load from the memory, As already discussed, we consider saving and loading through string variable as a feature request.

Please let me know if any concerns.

Regards,

Shyam G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;