Home Backend Development PHP Tutorial 富文本编辑器 删除图片有关问题

富文本编辑器 删除图片有关问题

Jun 13, 2016 pm 12:00 PM
ajax nbsp

富文本编辑器 删除图片问题
在一些富文本编辑器里面 插入图片时 会把图片上传到服务器, 但是当用户把原来的图片删除了 选新的图片上传的时候,就的图片没有在服务器上删除而新的图片又上传了,这样旧的图片是没有的而且占了服务器的资源。能否在用户按删除键的时候用ajax也把旧的图片删除,或者有没些其他的处理方法或者解决方案?
求做个博客之类的大神提供解决方案。
------解决方案--------------------
图片上传后,你可把图片名存到数据库中
待文档全部入库时检查一下是否图片有变化

修改编辑器也是可以的,但估计你没有这个水品
------解决方案--------------------
对上传图片做处理,上传之后,将路径保存到数据库,然后做个图片管理
------解决方案--------------------
上传文件成功:1.数据表字段保存上传图片图片路径。2.文件保存了上传图片。
删除操作:
1.直接删除数据库字段信息。
2.删除保存文件夹下的图片(ulink文件路径)。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

10 Ways to Adjust Brightness on Windows 11 10 Ways to Adjust Brightness on Windows 11 Dec 18, 2023 pm 02:21 PM

10 Ways to Adjust Brightness on Windows 11

How to turn off private browsing authentication for iPhone in Safari? How to turn off private browsing authentication for iPhone in Safari? Nov 29, 2023 pm 11:21 PM

How to turn off private browsing authentication for iPhone in Safari?

How to solve the 403 error encountered by jQuery AJAX request How to solve the 403 error encountered by jQuery AJAX request Feb 20, 2024 am 10:07 AM

How to solve the 403 error encountered by jQuery AJAX request

How to solve jQuery AJAX request 403 error How to solve jQuery AJAX request 403 error Feb 19, 2024 pm 05:55 PM

How to solve jQuery AJAX request 403 error

How to get variables from PHP method using Ajax? How to get variables from PHP method using Ajax? Mar 09, 2024 pm 05:36 PM

How to get variables from PHP method using Ajax?

How to solve the problem of jQuery AJAX error 403? How to solve the problem of jQuery AJAX error 403? Feb 23, 2024 pm 04:27 PM

How to solve the problem of jQuery AJAX error 403?

PHP vs. Ajax: Solutions for creating dynamically loaded content PHP vs. Ajax: Solutions for creating dynamically loaded content Jun 06, 2024 pm 01:12 PM

PHP vs. Ajax: Solutions for creating dynamically loaded content

Understanding Ajax Frameworks: Explore Five Common Frameworks Understanding Ajax Frameworks: Explore Five Common Frameworks Jan 26, 2024 am 09:28 AM

Understanding Ajax Frameworks: Explore Five Common Frameworks

See all articles