FileStorage in SQL DB problem

Last post 02-12-2009, 11:03 PM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  01-17-2009, 3:28 PM 47833

    FileStorage in SQL DB problem

    Hi,
    I have CE editor control inside EditTemplate in FormView and I'm using SQL DB as filesystem storage for everything. (SQL2008+.Net 3.5)
    The problem is that inserting images/Downloadable files works only one time: I can select an file/image, insert it in CE and save the content.
    But when I click an 'image gallery", "iNSERT iMAGE" or "Downloadable files" button again, I'm getting System.IO.DirectoryNotFoundException...
    It looks like CE tried to access upload folder in filesystem, instead of my DB....
    Sure, I reinitialize the following properties on Page_Load:
     Editor1.Setting["CuteEditorFileStorageType"] = typeof(CuteEditorSqlFileStorageProvider).AssemblyQualifiedName;
     Editor1.Setting[
    "DownFile"] = ResolveUrl("DownFile.Aspx");
     Editor1.SetSecurityGalleryPath(
    "/");
     
    Here is the exception: (part of the filesystem path is replaced with xxxxx)

    Could not find a part of the path xxxxxxxxx\uploads'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path xxxxxx\uploads'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [DirectoryNotFoundException: Could not find a part of the path 'xxxxxxxxx\uploads'.]
                System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +193
                System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption) +1923
                System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption) +37
                System.IO.Directory.GetDirectories(String path) +14
                CuteEditor.Impl.FileSystemStorage.GetDirectoryItems(String dirpath, Boolean getcount) +70
                CuteEditor.Dialogs.InsertGalleryFrame.b() +842
                CuteEditor.Dialogs.InsertGalleryFrame.OnLoad(EventArgs e) +45
                System.Web.UI.Control.LoadRecursive() +50
                System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
                
     

    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
     
    What am I doing wrong?
    Any help would be greatly appreciated.
     
    Boris
  •  01-17-2009, 10:28 PM 47834 in reply to 47833

    Re: FileStorage in SQL DB problem

    All,
    Further investigation revealed, that 'out dict'  variable, returned from
    CuteEditor.CEU.SplitEditorSetting(context,out culture,out policy,out dict) call
    in public CuteEditorSqlFileStorageProvider(HttpContext context):base(context) constructor is empty.
    It happened, because there is no 'setting' parameter in Request, passed in context...
     
    Any comments/suggestions would be appreciated
     
    /Boris
  •  01-18-2009, 12:31 AM 47835 in reply to 47833

    Re: FileStorage in SQL DB problem

    Hi
     
    We are investigating on this issue.
     
    I guest one of the url parameter lost when click the buttons.
     
    Regards,
    Terry
     
  •  01-18-2009, 12:03 PM 47841 in reply to 47835

    Re: FileStorage in SQL DB problem

    Tx Terry,

    Sorry, forgot to mention:
    I've been able to see that something is missing in Request only after I added
    following key in appSettings:
    <add key="CuteEditorFileStorageType" value="CuteEditorSqlFileStorageProvider, xxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    Without this, as I said in my first email, CE is using filesystem storageprovider, not my CuteEditorSqlFileStorageProvider....

    My feeling is that this problem related somehow to the place, where I host CE: in template in FormView.
    To repro, try to put CE in FormView's template, save the record (first time it works) and try to save again...
    It looks like Editor.Setting does not persist or something...

    /Boris

  •  02-12-2009, 11:03 PM 48735 in reply to 47841

    Re: FileStorage in SQL DB problem

    Boris,
     
    Hi, thanks for your description.
     
    We have conclution that, you set the Editor.Setting[...] on the DataBind event ?
     
    for security version , the Editor would not persist the value into ViewState.
     
    So You need set that property in the ItemCreated event .
     
    Regards,
    Terry
     
View as RSS news feed in XML