Hi there,
I'm having a problem with the FCKEditor image upload facility. I've searched the forum but nothing seems to help me. I hope you can find the time to offer some advice - I'm a little confused!
Firstly, I have the following properties declared for my editor:
string imagepath = "Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/companyData/fiona/resources/&ServerPath=/companyData/fiona/resources/";
FCKeditor1.ImageBrowserURL = sPath + "editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx?" + imagepath ;
I find that if I leave out the "imagepath" string here, I get an XML 500 server error.
The browser opens when the image button is clicked, but with a JS error (line 115 of frmresourceslist.html - object required), which seems to me as if the XML isn't getting through. Now, this is the part I'm really unsure of - how to actually create and pass this XML.
I've edited my connector.aspx codebehind thus:
string basepath = Server.MapPath("/companyData/fiona");
// does company folder exist?
if(!Directory.Exists(basepath))
Directory.CreateDirectory(basepath);
basepath+="/resources";
//does resources dir exist?
if(!Directory.Exists(basepath))
Directory.CreateDirectory(basepath);
string xml = "<?xml version="1.0\" encoding=\"utf-8\" ?>\n";
xml += "<Connector command=\"" + Request.QueryString["Command"] + "\" resourceType=\"" + Request.QueryString["Type"] + "\">\n";
xml += "<CurrentFolder path=\"" + Request.QueryString["CurrentFolder"] + "\" url=\"/companyData/fiona/resources/images/\" />\n";
//<snippet>... if query string Command = "GetFoldersAndFiles"...
string [] dirs = Directory.GetDirectories(basepath);
xml += "<Folders>\n";
for(int i=0;i<dirs.Length;i++)
{
xml += "<Folder name=\"" + dirs[i] + "\" />\n";
}
xml += "</Folders>\n";
string[] files = Directory.GetFiles(basepath);
xml += "<Files>\n";
for(int i=0;i<files.Length;i++)
{
xml += "<File name=\"" + files[i] + "\" size=\"" + files[i].Length + "\" />\n";
}
xml += "</Files>\n";
//...</snippet>
xml += "</Connector>";
strXML= xml;
and my connector.aspx then just displays strXML, which should be in the format:
<?xml version="1.0" encoding="utf-8" ?>
<Connector command="GetFoldersAndFiles" resourceType="Image">
<CurrentFolder path="/companyData/fiona/resources/" url="/companyData/fiona/resources/images/" />
<Folders>
<Folder name="d:\inetpub\wwwroot\netsite\companyData\fiona/resources\imadethisdirectly" />
</Folders>
<Files>
</Files>
</Connector>
If I call the connector directly with the correct URL params, this is what I get.
Is this enough? And ifso, why is it falling over?
Hope you can shed some light - thanks for your time
Fiona
RE: Please help with image filebrowser - .NET