How can we solve the issue where a user uploads an image named "image1.png", later deletes it, and replaces it with another image named "image2.png", but the storage or database system fails to delete the previously deleted "image1.png" so that database have Two images but we are using only one. any solution?
Sorry, nothing impressive about this script at all. Upload an image then delete the image from the text editor, but it still remains in the upload folder. There is no image management at all. If you upload several images and remove one or more from the editor, it keeps all the uploaded images in the upload folder. In reality, when images are uploaded to the editor each image should be renamed to something like a hash.ext and then when the person has finished editing then click a save button, the content of the editor should be saved to the target location such as a db and then the images should be uploaded right after. The editor should only contain the image hashname.ext and not the actual image. When a person wants to go back and edit anything at a later date, the editor should load up the info from the db where the image links point to each photo uploaded in the upload directory. Each time they save, the directory containing all the uploaded images should be destroyed and a new directory should be created (to flush out any stray images).
Images itself from the folder are not meant to be deleted from the text editor. In text editor you can re-use your previously uploaded images. You can only delete a file like image from a file manager, not from text editor. You can re-use a same image in different text areas in your website. (Like about us, gallery etc.) so as per your logic, if you delete the image from about us text editor, the image will be unavailable through various pages which had used it.
To me it's not working, the image upload correctly, but receive a specific name and not appearing in the text area.
In localhost it runs fine but not in the server
Can you do tutorial for videos?
How can we solve the issue where a user uploads an image named "image1.png", later deletes it, and replaces it with another image named "image2.png", but the storage or database system fails to delete the previously deleted "image1.png" so that database have Two images but we are using only one. any solution?
Cool stuff
its not working on live server
me too not working, why can u solve?
Delete/comment code with start if(isset($_SERVER['HTTP_ORIGIN']... until if end
Sorry, nothing impressive about this script at all. Upload an image then delete the image from the text editor, but it still remains in the upload folder. There is no image management at all. If you upload several images and remove one or more from the editor, it keeps all the uploaded images in the upload folder. In reality, when images are uploaded to the editor each image should be renamed to something like a hash.ext and then when the person has finished editing then click a save button, the content of the editor should be saved to the target location such as a db and then the images should be uploaded right after. The editor should only contain the image hashname.ext and not the actual image. When a person wants to go back and edit anything at a later date, the editor should load up the info from the db where the image links point to each photo uploaded in the upload directory. Each time they save, the directory containing all the uploaded images should be destroyed and a new directory should be created (to flush out any stray images).
so can u do a tutorial on this then?
Images itself from the folder are not meant to be deleted from the text editor. In text editor you can re-use your previously uploaded images. You can only delete a file like image from a file manager, not from text editor. You can re-use a same image in different text areas in your website. (Like about us, gallery etc.) so as per your logic, if you delete the image from about us text editor, the image will be unavailable through various pages which had used it.