سلام و خسته نباشید
از fck editor استفاده کردم در پروژه ام نیاز دارم که عکس آپلود کنم از طریق آن
سرچ کردم تغییرات رو در فایل FredCK.FCKeditorV2.FileBrowser.Config اعمال کردم اما وقتی عکس ارسال می کنم خطا میده که فرمت فایل صحیح نیست.دیباگ هم کردم اما متوجه نشدم. لطفا پاسخ بدین.
تنظیمات فایل رو به صورت زیر قراردادم.
<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %> <script runat="server"> private bool CheckAuthentication() { if (Session.Count > 0) { return true; } return false; } public override void SetConfig() { Enabled = CheckAuthentication(); // URL path to user files. UserFilesPath = "~/userfiles/"; UserFilesAbsolutePath = Server.MapPath("~/UserFiles/"); ForceSingleExtension = true; // Allowed Resource Types AllowedTypes = new string[] { "File", "Image", "Flash", "Media" }; // For security, HTML is allowed in the first Kb of data for files having the // following extensions only. HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" }; TypeConfig["File"].AllowedExtensions = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xml", "zip" }; TypeConfig["File"].DeniedExtensions = new string[] { }; TypeConfig["File"].FilesPath = "%UserFilesPath%file/"; TypeConfig["File"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/"); TypeConfig["File"].QuickUploadPath = "%UserFilesPath%"; TypeConfig["File"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%"); TypeConfig["Image"].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png", "pdf", "ppt", "pptx", "doc", "docx", "xls", "xlsx" }; TypeConfig["Image"].DeniedExtensions = new string[] { }; TypeConfig["Image"].FilesPath = "%UserFilesPath%image/"; TypeConfig["Image"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/"); TypeConfig["Image"].QuickUploadPath = "%UserFilesPath%"; TypeConfig["Image"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%"); TypeConfig["Flash"].AllowedExtensions = new string[] { "swf", "flv" }; TypeConfig["Flash"].DeniedExtensions = new string[] { }; TypeConfig["Flash"].FilesPath = "%UserFilesPath%flash/"; TypeConfig["Flash"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/"); TypeConfig["Flash"].QuickUploadPath = "%UserFilesPath%"; TypeConfig["Flash"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%"); TypeConfig["Media"].AllowedExtensions = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" }; TypeConfig["Media"].DeniedExtensions = new string[] { }; TypeConfig["Media"].FilesPath = "%UserFilesPath%media/"; TypeConfig["Media"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/"); TypeConfig["Media"].QuickUploadPath = "%UserFilesPath%"; TypeConfig["Media"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%"); } </script>
و اینکه پوشه UserFiles هم در روت پروژه قرار گرفته.اینم عکس خطا
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)