Fckeditor is an open source online html editor. In my project I use it in the article-add page. The usage is very easy, all you need to do is put the "fckeditor" folder under Web-Root directory and write some lines as below:
<script>
var editor = new FCKeditor('content');
editor.BasePath='/myproject/fckeditor/';
editor.ToolbarSet='UserToolbar';
editor.Create();
</script>
Of course there are other attributes with "editor", you can set them according to you quirements. What I want to mention is the upload function. When we use the upload function, take "image upload" for example, after uploading the image, generally, which we choose from our local PC, the frame change to "Attribute" window automatically, and the URL for the image we just uploaded like this:
/myproject/userfiles/image/myimage.jpg. It is OK when I test the function on my own computer, but something wrong happens when I do the same thing on the Internet. Because on my computer I use the IP to connect the Web-application but on the Internet I use the domain name. For example, the domain name is
http://my.myforge.org and it is binding to an IP 192.168.0.1:8080/myproject. After uploading the image, I get the URL as follows:
/myproject/myproject/userfiles/image/myimage.jpg. It is easy to find that the "myproject" is duplicated and the image can't be linked exactly to the server. The domain binding to the IP can't be changed, so I try to alter the URL the "uploading function" returned.
After study on the source code, I solve the problem at last and it is only a matter of one centence.Take "image upload" for instance, first open fck_image.js under fckeditor/editor/dialog/fck_image. You could find a function OnUploadCompleted(), near the bottom line of the function you could find SetUrl(fileUrl);, then I change it to: fileUrl = fileUrl.substring(10,fileUrl.length); SetUrl( fileUrl ) ;.The result of this chang is the first /myproject will be deleted before it is returned to the "Attribute" window. The number 10 is mutative according to you application name.
分享到:
相关推荐
Setting the Application Name and Icon 122 Enforcing Application System Requirements 123 Targeting Specific SDK Versions 123 Enforcing Application Platform Requirements 126 Working with External ...
With the recently released 4th Version, Laravel became even better in numerous ways. Within this book, we will help you learn about both the old and new features of Laravel while developing various ...
Uploading and Downloading Files in Web Dynpro Java
file-uploading-with-php-and-mysql
Data uploading mechanism for internet of things with energy harvesting
Uploading a file to a remote server 66 Caching content using the web storage local storage API 70 Chapter 3: Working with Audio, Images, and Video 79 Introduction 79 Capturing audio using the devices ...
image uploading and manipulation; content management; forms and user input; integrating your website with others; creating chat and messaging services; using MySQL; managing sessions and cookies; ...
23)..Added: Support for uploading multiple files in JIRA 24)..Added: EResLeaks improvements (new funcs: ResourceAdd, ResourceDelete, ResourceName; support for realloc-like functions) 25)..Fixed: Added...
化妆品培训材料.pptx.baiduyun.uploading.cfg
Uploading Desktop
- Share your application by uploading it to the cloud with CloudFoundry - Get basic tips for writing maintainable code on both client and server ☆ 出版信息:☆ [作者信息] Semmy Purewal [出版机构] ...
Optional Grid-Add, Grid-Edit, Inline-Add, Inline-Copy, Inline-Delete, Inline-Edit right in the List page Optional confirmation page before insering or updating record Pagers in List/View page Fully ...
化妆品工艺.pptx.baiduyun.uploading.cfg
This book will teach you how to start with “Hello World” and ends with uploading or controlling your Sensor data’s from all over the world. why you are still waiting for? Go ahead and enjoy the ...
url - the url where to post uploaded files. base_params - additional post params (default to {}). permitted_extensions - array of file extensions which are permitted to upload (default to []). ...
const URL, Description: String) procedure for sending URLs[+] Added SetSelfInfoGeneral, SetSelfInfoMore, SetSelfInfoAbout procedures for uploading the self info[-] Fixed SearchByName procedure, now ...
在 Sails 中上传文件Sails 使用skipper上传文件如何使用此代码git clone https://github.com/maangalabs/uploading-file-in-sails.gitcd uploading-file-in-sailssudo npm installsails lift转到...
Ensuring a Name Is Defined in a Given Module Chapter 5. Searching and Sorting Introduction Recipe 5.1. Sorting a Dictionary Recipe 5.2. Sorting a List of Strings Case-Insensitively Recipe ...
Package contains two bonus components from Advanced Application Controls pack: auHTTP (WinInet-based HTTP client which also supports file uploading via HTTP, (introduced in RFC1867), Internet ...