set the upload folder to the current month

Last post 05-04-2009, 9:43 AM by acecuteeditor. 2 replies.
Sort Posts: Previous Next
  •  05-04-2009, 7:05 AM 51778

    set the upload folder to the current month

    How do I need to set the upload folder so that it automatically get changed to the current month.
     
    <security name="FilesGalleryPath">~/uploads/currentmonth</security>
  •  05-04-2009, 8:51 AM 51781 in reply to 51778

    Re: set the upload folder to the current month

    Hi acecuteeditor,
     
    Try this way
     
    ---------------------------------------------->
     

    <%@ Page Language="C#" AutoEventWireup="True" %>

    <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <script runat="server">
     
     
        protected override void OnLoad(EventArgs e)
        {
            Editor1.Setting["security:FilesGalleryPath"] = "~/Uploads/" + DateTime.Now.Month.ToString();
            base.OnLoad(e);
        }
    </script>

    <head id="Head1" runat="server">
        <title>test</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <CE:Editor ID="Editor1" runat="server">
            </CE:Editor>
        </form>
    </body>
    </html>
    ---------------------------------------------->
     
    Regards,
     
    Ken
  •  05-04-2009, 9:43 AM 51785 in reply to 51781

    Re: set the upload folder to the current month

    Thank You. It worked.
View as RSS news feed in XML