Can't save to file

Last post 09-28-2004, 8:32 PM by jaguy. 8 replies.
Sort Posts: Previous Next
  •  02-29-2004, 10:23 AM 473

    Can't save to file

    I am having som problems saving the html code to an file.

     

    private void gem_ServerClick(object sender, System.EventArgs e)

    {

    Editor1.SaveFile("brugere/" + Session["kundenr"] + "/sider/" + filNavn.Value + ".htm");

    }

     

    Sometimes it is saved but the most of the time it isn't.

     

    What do i do wrong?

  •  03-01-2004, 8:21 AM 475 in reply to 473

    Re: Can't save to file

    Pnr,

     

    Make sure ASPNET account has write permissions and your session doesn't expire.

     

    Can you test it without usiing session variable?

     

    private void gem_ServerClick(object sender, System.EventArgs e)

    {

    Editor1.SaveFile("brugere/test/sider/" + filNavn.Value + ".htm");

    }


    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

  •  03-02-2004, 12:50 AM 478 in reply to 475

    Re: Can't save to file

     

    I have tried that but still the same problem.

    I found out that when I have loaded the file:

     

    Editor1.LoadHtml("brugere/1/default.htm");

     

    The file is locked until I have made changes to the code and compiled it again, when I have done that the changes I have made in CuteEditor before I compiled is saved to the file.

     

               Editor1.SaveFile("brugere/1/default.htm");

     

    //Peter

     

  •  03-02-2004, 3:40 PM 485 in reply to 478

    Re: Can't save to file

    Peter:

     

    Sometimes it is saved but the most of the time it isn't.

     

     

    I believe the web browsers cacheand maintain a local copy of static web pages and other related items on your disk or memory to speedup reloading of previously visited pages.

     

    Make sure you clear your browser's cache before you see the changes.


    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

  •  03-02-2004, 9:56 PM 490 in reply to 485

    Re: Can't save to file

    I have added this in top of the aspx file:

     

      <META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT">
     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
     <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">

    It is now saving more offen but not all the time, why is this a problem to me (I am using Internet Explore 6.0 as default)?

     

    What can i do to make tis work everytime?

  •  03-02-2004, 10:06 PM 491 in reply to 490

    Re: Can't save to file

    I have also tried adding this to the page_Load in the .cs file:

     

    Response.Expires = -1;

    Response.AddHeader("pragma", "no-cache");

    Response.CacheControl="no-cache";

    Response.AddHeader("cache-control", "no-store");

     

    Still not working, it somtimes works when i add text to the file, but when i delete some text in the file it newer works.

  •  03-03-2004, 10:03 AM 494 in reply to 491

    Re: Can't save to file

    Hi PNR,

    Have you tried something like this ?

     

    Dim sw As StreamWriter = New StreamWriter(server.mappath("myfile"))
    sw.Write(Editor1.PlainText)
    sw.Close()

     

    It worked out ok for me.

    Also, on IE6 / win2K I had to add permission to ASPNET user.

    On IE6 / win2003server, it was not enough, I had to add permission to IIS and IWAM (although I still don't understand why).

    Good luck !

    julien

     

  •  03-03-2004, 11:26 AM 496 in reply to 494

    Re: Can't save to file

    Thanks very much Julien!

     

    Now i can save the code, i have done it like this:

    StreamWriter sw = new StreamWriter(Server.MapPath(sti + "/brugere/"+ Session["kundenr"] + "/default.htm"));

    sw.Write(Editor1.Text);

    sw.Close();

     

  •  09-28-2004, 8:32 PM 1943 in reply to 494

    Re: Can't save to file

    I used the above technique, but I am having the same problem. Sometimes it sames and sometimes it don't. Sometimes I have to copy the contents and paste it and save again. That's kind of annoying.
View as RSS news feed in XML