Disallowing Uploads

Last post 08-24-2007, 8:07 PM by clubside. 5 replies.
Sort Posts: Previous Next
  •  08-24-2007, 11:24 AM 32852

    Disallowing Uploads

    Howdy,
     
    I'm trying to make the switch from TinyMCE to CuteEditor but there are a number of issues stopping me at the moment, this being the most important.
     
    In my app I'm hapy to let people insert images and other media via http:// reference but I don't want to allow uploads. I've tried setting supported formats to a null string or maximum size to 0 but neither prevents this functionality. Any advice?
     
    I'd like to make a suggestion at this time that there be two different media dialogs, one for only linking (no gallery or upload functionality) and the currrent one.
     
    Thanks for any help!
    Chris Rowley
     
    P.S. By the way, why are your Css Class and other combos the same height as the buttons? Is that something you could only achieve in the .Net version? On the ASP control they are too tall, not lining up in height with the other buttons.
     
  •  08-24-2007, 11:44 AM 32855 in reply to 32852

    Re: Disallowing Uploads

    Chris,

    You can easily disable upload using the following methods:

    1: Edit security policy file.

    The security policy file (default.config, admin.config and guest.config) can be found in the CuteEditor_Files/Configuration/Security folder. In security policy file you can find the MaxImageSize element which contains the value of max image file upload size limit (in kbs).  By default, it contains the following value:

    <security name="AllowUpload">true</security>
     <security name="AllowCreateFolder">true</security>
     <security name="AllowRename">true</security>
     <security name="AllowDelete">true</security>
     
    You can set the above value to false to meet your requirements.

    For example: 

    <security name="AllowUpload">false</security>
     <security name="AllowCreateFolder">false</security>
     <security name="AllowRename">false</security>
     <security name="AllowDelete">false</security>


    2: Programmatically disable upload.
    In some situation, you can detect who is the admin user. In this situation, you can allow the admin upload the files, and disallow the other users upload/delete/create files.
     
    Example:
     
    If Not IsAdmin then

       editor.AllowUpload= false   
       editor.AllowCreateFolder= false   
       editor.AllowRename= false   
       editor.AllowDelete= false
     
    End If
     
    >>P.S. By the way, why are your Css Class and other combos the same height as the buttons? Is that something you could only achieve in the .Net version? On the ASP control they are too tall, not lining up in height with the other buttons.
     
    It should to be the same height.

    Check this demo:
     
     
    Hope it helps. Let me know if you have any further questions.
     
     
     
     


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-24-2007, 12:28 PM 32860 in reply to 32855

    Re: Disallowing Uploads

    Hey Adam,
     
    Thanks for the quick reply! That took care of everything. I was using the Members part of the help trying to find things and none of thse properties are mentioned there!
     
    As for the rendering thing, you are right, the sample runs fine from your server or mine. However, inserted into my app I get this on IE7:
     
     
    With the toolbar rows distended, especially the cobo ones, where Firefox does it fine:
     
     
    I would have to guess it is related to my stylesheet somehow but know where to begin to look. Any ideas?
     
    Chris Rowley
     
  •  08-24-2007, 2:19 PM 32866 in reply to 32860

    Re: Disallowing Uploads

    Chris,
     
    Try put the dropdowns into a separate group.
     

      <item type="g_start" />
      <item type="dropdown" name="Links" text="[[Links]]" width="60" command="InsertLink" />
      <item type="dropdown" name="Codes" width="90" RenderItemBorder="true" text="[[Codes]]" />
      <item type="dropdown" name="Images" width="60" RenderItemBorder="true" text="[[Images]]" />
      <item type="dropdown" name="Zoom" text="[[Zoom]]" width="50" command="Zoom" />
      <item type="g_end" />
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-24-2007, 3:00 PM 32871 in reply to 32866

    Re: Disallowing Uploads

    Hey Adam,
     
    They are in different groups. And as you can see in Firefox all us well. In IE not only are the combos too tall, the drop-down icon is too low, and the other two bars are too tall with the button groups not even centered. Can the control be affected by my own site-wide CSS? Although that doesn't sound right with Firefox being happy.
     
     Here's my configuration file:
     
     
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <codeviewToolbars>
    <item type="g_start" />
    <item type="image" name="Print" />
    <item type="image" name="Find" />
    <item type="image" name="ToFullPage" command="FullPage" imagename="fit" hotkey="F12" />
    <item type="image" name="FromFullPage" command="FullPage" imagename="restore" hotkey="F12" />
    <item type="image" name="Cut" />
    <item type="image" name="Copy" />
    <item type="image" name="Paste" />
    <item type="image" name="SelectAll" />
    <item type="image" name="SelectNone" />
    <item type="g_end" />
    </codeviewToolbars>
    <toolbars>
    <item type="g_start" />
    <item type="image" name="New" imagename="newdoc" />
    <item type="image" name="Print" />
    <item type="image" name="Preview" imagename="bspreview" />
    <item type="image" name="Find" />
    <item type="image" name="ToFullPage" command="FullPage" imagename="fit" hotkey="F12" />
    <item type="image" name="FromFullPage" command="FullPage" imagename="restore" hotkey="F12" />
    <!--
    <item type="image" name="EditInNewWindow" />
    -->
    <item type="image" name="CleanCode" imagename="cleanup" />
    <item type="image" name="NetSpell" imagename="spell" />
    <item type="separator" />
    <item type="image" name="Cut" />
    <item type="image" name="Copy" />
    <item type="image" name="Paste" />
    <item type="image" name="PasteText" />
    <item type="image" name="PasteWord" />
    <item type="image" name="PasteAsHTML" />
    <item type="image" name="Delete" />
    <item type="separator" />
    <item type="image" name="Undo" />
    <item type="image" name="Redo" />
    <item type="g_end" />
    <item type="g_start" />
    <item type="image" name="Break" />
    <item type="image" name="InsertParagraph" imagename="Paragraph" />
    <item type="image" name="InsertPageBreak" imagename="InsertPageBreak" />
    <item type="separator" />
    <item type="image" name="InsertChars" imagename="specialchar" />
    <item type="image" name="UniversalKeyboard" imagename="keyboard" />
    <!--<item type="image" name="InsertText" imagename="text" />-->
    <!--<item type="image" name="InsertFieldSet" imagename="text" />-->
    <item type="separator" />
    <item type="image" name="InsertImage" imagename="eximage" />
    <item type="image" name="InsertFlash" imagename="flash" />
    <item type="image" name="InsertMedia" imagename="media" />
    <item type="g_end" />
    <item type="linebreak" />
    <item type="g_start" />
    <item type="image" name="Bold" />
    <item type="image" name="Italic" />
    <item type="image" name="Underline" imagename="under" />
    <item type="image" name="Superscript" />
    <item type="image" name="Subscript" />
    <item type="image" name="Strikethrough" imagename="strike" />
    <item type="g_end" />
    <item type="g_start" />
    <item type="image" name="JustifyLeft" imagename="left" />
    <item type="image" name="JustifyCenter" imagename="center" />
    <item type="image" name="JustifyRight" imagename="right" />
    <item type="image" name="JustifyFull" />
    <item type="image" name="JustifyNone" />
    <item type="image" name="RemoveFormat" imagename="unformat" />
    <item type="forecolor" />
    <item type="backcolor" />
    <item type="g_end" />
    <item type="g_start" />
    <item type="image" name="InsertOrderedList" imagename="numlist" />
    <item type="image" name="InsertUnorderedList" imagename="bullist" />
    <item type="image" name="Indent" />
    <item type="image" name="Outdent" />
    <item type="g_end" />
    <item type="g_start" />
    <item type="image" name="InsertHorizontalRule" imagename="rule" />
    <item type="image" name="InsertLink" imagename="link" />
    <item type="image" name="Unlink" />
    <item type="image" name="InsertAnchor" imagename="anchor" />
    <item type="g_end" />
    <item type="linebreak" />
    <item type="g_start" />
    <item type="dropdown" name="CssStyle" width="70" RenderItemBorder="true" text="[[CssStyle]]" command="CssStyle" />
    <item type="dropdown" name="FormatBlock" width="70" RenderItemBorder="true" text="[[Paragraph]]" command="FormatBlock" />
    <item type="g_end" />
    <item type="g_start" />
    <item type="table" />
    <!-- item type="image" name="InsertTable" imagename="instable" /-->
    <item type="image" name="InsertRowTop" imagename="insrow_t" />
    <item type="image" name="InsertRowBottom" imagename="insrow_b" />
    <item type="image" name="DeleteRow" imagename="delrow" />
    <item type="image" name="InsertColumnLeft" imagename="inscol_l" />
    <item type="image" name="InsertColumnRight" imagename="inscol_r" />
    <item type="image" name="DeleteColumn" imagename="delcol" />
    <item type="image" name="InsertCell" imagename="inscell" />
    <item type="image" name="DeleteCell" imagename="delcell" />
    <item type="image" name="EditRow" imagename="row" />
    <item type="image" name="EditCell" imagename="cell" />
    <item type="image" name="MergeRight" imagename="mrgcell_r" />
    <item type="image" name="MergeBottom" imagename="mrgcell_b" />
    <item type="image" name="HorSplitCell" imagename="spltcell_r" />
    <item type="image" name="VerSplitCell" imagename="spltcell_b" />
    <!-- MergeCell/mrgcell SplitCell/spltcell -->
    <item type="g_end" />
    </toolbars>
    </configuration>
    
     
    I don't know if that helps but figured I'd pass it along...
     
    Thanks again for all the help...
    Chris Rowley
     
  •  08-24-2007, 8:07 PM 32881 in reply to 32871

    Re: Disallowing Uploads

    Hey Adam,
     
    I was able to create an isolated version of my code that shows the IE effect I was talking about. Included in this archive are the original simple.asp modified only to use my toolbar and other configurations. After that simple1.asp has my content but your stylesheet and renders the toolbars as far as I can tell the same. The third version, simple2.asp, replaces your linked stylesheet with my inline styles. Please don't laugh, they go back to 2001 and are being revised! With this page you'll get exactly the same results as the sample image. Obviously something related to tables in my stylesheet corrupts CuteEditor. Why in tables? Because if I include my stylesheet but don't wrap the control in my sample table display the corruption doesn't happen.
     
    If there's too much to deal with here I'd be happy to open a support ticket...
     
    Thanks again!
    Chris Rowley
     
     
View as RSS news feed in XML