问题
The image uploaded using FCKEditor control has to be inserted into database. Anyone please help in how to get the image uploaded using FCK Editor control('image' button). The user should also be able to directly upload image from their local computer without uploading it to the server. The image choosen should be inserted into database directly. I have writtern function to insert image into database but do not know how to get the choosen image from FCKEditor control!
回答1:
You can do that with this trick
- Step 1 : first save Image in folder
- Step 2 : then find all image tag in FCKeditor's content with XPath you can use htmlAgility for that
- Step 3 : find image path from it and pick Image from folder convert into bytes and save to DB and delete that Image from folder
- Step 4 : replace Image src's value from your Httphandlors path (for showing image)
来源:https://stackoverflow.com/questions/5802912/retrieve-uploaded-image-from-fck-editor-and-insert-into-database