Tthis office viewer component could retrieve and save the physical files form the server when we provide the respective file paths. This component also support to load/save the content of the documents through RTF formatted strings. These strings will be saved and retrieved as it is from the database. The developers can write javascript functions within JSPs to provide access to javascript variables to take these RTF formatted string values.
Firstly, the component can open a rtf file from server with the stream mode.
Referent the following page to write a asp.net page in your server to read file to stream.
http://www.edrawsoft.com/httpopenfilefromstream.php
Then use the following javascript to load the file into component.
<script language=”vbscript”>
Sub DownloadFile()
EDOffice.HttpInit();
EDOffice.HttpAddpostString(“DocumentID”, “name.rtf”);
EDOffice.HttpOpenFileFromStream(“http://localhost:2440/ASPCSharp/UploadAction.aspx”, “Word.Application”);
End Sub
</script>
To save rtf file back to server, you need call the following method.
http://www.edrawsoft.com/httpupload-office-files.php
<script language=”vbscript”>
Sub UploadFile()
EDOffice.HttpInit
EDOffice.HttpAddpostString “author”, “anyname”
EDOffice.HttpAddpostString “Data”, “2010-5-15”
EDOffice.HttpAddPostOpenedFile filename.rtf, 6 ;wdFormatRTF = 6,
EDOffice.HttpPost “http://localhost:1320/Samples/UploadAction.aspx”
End Sub
< /script>
Leave a Reply
You must be logged in to post a comment.
Recent Comments