Delete application name in URL after uploading with Fckeditor

本文介绍了解决FCKeditor中图片上传后路径重复的问题,通过修改源代码来确保图片链接能够正确指向服务器地址,适用于从本地IP切换到域名部署的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.
<think>好的,用户想知道如何使用HiBurn软件进行上传操作。首先,我需要确认HiBurn的具体用途和常见步骤。根据用户提供的引用内容,例如引用[1]提到使用sendKeys()方法上传文件,引用[2]关于C语言创建txt文件,引用[3]到[5]涉及数据科学和安装相关的内容,但这些可能与HiBurn的直接关联不大。不过,可以推测HiBurn可能是一个用于烧录或上传文件的工具,类似于嵌入式开发中的烧录软件。 接下来,我需要整理HiBurn的一般使用步骤。通常,这类软件需要连接设备,选择文件,配置参数,然后执行上传。例如,连接开发板到电脑,选择固件文件,设置波特率、起始地址等参数,然后开始烧录。用户可能需要具体的操作指南,比如如何选择文件路径,如何启动上传过程。 此外,用户可能遇到连接问题或文件格式不兼容的情况,需要提供常见问题的解决方法。例如,检查驱动是否安装,确认文件格式是否正确,查看日志信息等。根据引用[1]中提到的上传方法,可能需要类似的选择文件步骤,但HiBurn可能有自己的界面和操作流程。 需要确保回答结构清晰,分步骤说明,并包含注意事项和示例。同时,生成的相关问题应围绕HiBurn的使用场景、故障排除和高级功能展开,帮助用户进一步了解该工具。最后,引用相关的参考资料,尽管现有引用中没有直接提到HiBurn,但可以关联到文件操作和上传的基本原理。</think>### 如何使用HiBurn进行上传操作? HiBurn通常用于嵌入式系统开发中的固件烧录或文件上传(例如单片机、ARM开发板等)。以下是详细操作步骤: #### 步骤1:连接硬件设备 1. 使用USB转串口线或专用调试器连接目标设备与电脑 2. 在HiBurn中选择正确的接口类型(如UART、JTAG等) 3. 设置通信参数:波特率(常见值:$115200$)、数据位、校验位等[^2] #### 步骤2:配置烧录参数 ```plaintext [示例配置] Baud Rate: 115200 Flash Type: NOR Flash Start Address: 0x00000000 File Format: Binary (.bin) ``` #### 步骤3:选择上传文件 1. 点击"Browse"或"Load File"按钮 2. 选择需要上传的固件文件(支持格式:.bin、.hex、.axf等) 3. 验证文件校验和(可选) #### 步骤4:执行上传操作 1. 确认设备已进入烧录模式(可能需要复位设备) 2. 点击"Program"或"Download"按钮启动上传 3. 观察进度条和日志窗口,直到显示"Download Success" #### 注意事项 - 确保供电稳定,电压波动可能导致烧录失败 - SPI Flash设备需先执行擦除操作(Erase) - 若使用加密传输,需提前配置密钥参数 - 部分设备需要冷启动才能进入烧录模式[^1] ### 常见问题排查 | 现象 | 解决方案 | |------|----------| | 连接超时 | 检查串口线连接,确认COM端口号正确 | | 校验失败 | 重新生成固件文件,验证文件完整性 | | 地址错误 | 核对设备手册中的存储映射表 |
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值