Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

UserDictionary file path set to a file in the solution (not C:\...)? - RapidSpell Web ASP.NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
Dan_P
#1 Posted : Thursday, September 8, 2016 2:33:15 PM
Rank: Newbie

Groups: Registered

Joined: 9/8/2016
Posts: 3
Hello RapidSpell support,

I am trying to add the functionality of adding words to a user's dictionary, which works for me if I set the path to a local folder (such as C:\ drive). However that would not be of much use when I upload the solution. How can I set that path to the user's dictionary txt file on the server, like any other file or page? So, for example if the UserDictionary file was in the same folder as the page which has the rapidspellweblauncher, the file path would be just "UserDictionary.txt", or if it was in the parent folder it would be "../UserDictionary.txt".
Or if this is not how it works, how do I reference that file on the server?
Thank you very much in advance.

Kind regards,

Dan
Jim
#2 Posted : Thursday, September 8, 2016 5:22:02 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
Hi Dan, assuming you're using our Javascript based usage, please see https://keyoti.com/produ...ode/User_dictionary.htm

What I think you need is to use "~/user-dictionary.txt" the important bit being the ~/ which means the root of the application. You can of course change it to be user specific like

rapidSpell.setParameterValue('default', 'UserDictionaryFile', '~/dictionaries/'+userID+'.txt)


Otherwise https://keyoti.com/produ...User%20Dictionaries.htm you can use MapPath to go from a virtual path to a real one.



Please let me know if any questions,
Jim
-your feedback is helpful to other users, thank you!


Dan_P
#3 Posted : Thursday, September 8, 2016 5:33:57 PM
Rank: Newbie

Groups: Registered

Joined: 9/8/2016
Posts: 3
Hello Jim,

Thank you very much for such a quick reply. I've tried setting the path to the root of the application using ~/, but unfortunately it still points to a folder on the local drive.

My user dictionary file is located in the folder 'Spelling' in the root of the application, so I've set the path as following:
Code:
UserDictionaryFile="~/Spelling/UserDictionary.txt"
However I still get a similar error: Could not find a part of the path 'C:\Windows\SysWOW64\inetsrv\~\Spelling\UserDictionary.txt'. when I try to open the spell checker.

Here is my radspellweblauncher component:

Code:
<rapidspellweb:rapidspellweblauncher id="RapidSpellWebLauncher1" runat="server"
textcomponentname="editor1" rapidspellwebpage="../../Spelling/Popup.aspx" ignorexml="True"
ignorecapitalizedwords="True" TextComponentInterface="Automatic" sslfriendly="True" FinishedListener="SpellFinish"
UserDictionaryFile="~/Spelling/UserDictionary.txt">
</rapidspellweb:rapidspellweblauncher>


Strangely enough, if you look at the rapidspellwebpage path, which points to a folder within the solution, it works perfectly. Any idea on how this could be fixed/solved?

By the way, unfortunately the link that you've sent me, is not functional anymore.

Thanks again in advance.

Kind regards,

Dan
Jim
#4 Posted : Thursday, September 8, 2016 6:19:05 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
Thanks I fixed the link.

https://keyoti.com/produ...User%20Dictionaries.htm

I think for the server control usage, you're going to need to set it in code behind with a call to MapPath, let me know if that's a problem please.

Jim
-your feedback is helpful to other users, thank you!


Dan_P
#5 Posted : Friday, September 9, 2016 11:54:52 AM
Rank: Newbie

Groups: Registered

Joined: 9/8/2016
Posts: 3
Hello Jim,

Thank you very much, setting the path using MapPath worked perfectly.

Kind regards,

Dan
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.