|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
To all who may be interested:
I recently read Mitchell Harper's excellent series of articles entitled "Building a WYSIWYG HTML Editor," and thought of one useful addition: is it possible to modify the editor so that the user could insert locally-stored images, have those images display in the editor, and then have the editor upload those images to the server on submission? Obviously, with this change in place, the editor could successfully emulate the functionality of, say, Microsoft FrontPage! I'm not sure what sort of implications this would have, but I'd appreciate any comments, questions, suggestions, etc. relating to this topic. Thank you for your time and have a good one. |
|
#2
|
|||
|
|||
|
the best way is to have a image center, where you can upload delete and view images, the you select a image and with a bit of javascipt add it to your editor, im not sure how you would do this in asp.
|
|
#3
|
|||
|
|||
|
Hey,
Well Mitch wrote those article and saved some of the "good stuff" for our software product, ConMan. For an idea on how to setup an image manager, checkout www.contentconcepts.com/onlinedemo.php, which is where you can try conman and see how it works, etc ![]() you should be able to get some nice ideas from it. |
|
#4
|
|||
|
|||
|
Re: WYSIWYG Editor and Image Uploading
Quote:
If you want to get into the nuts and bolts of asp, I'd suggest having a look at this product, which is a free asp based file manager : http://www.iisworks.com/fileman/ And, of course, check out ConMan. ![]() Alternatively, if you're interested in learning a new technology, try ASP.NET, which has a pretty good native method built in now, so you don't have to muck about with vbscript classes any more. |
|
#5
|
|||
|
|||
|
Yes I have done this in ASP for a content management system I developed for our intranet here. I use ASPUpload but it is possible to do it with free components.
Summary: You need to add a button to the editor that opens another window, containing a file upload field. This will browse the local PC for the image, & upload to a specified directory. Once this is done, you close the new window & pass the url of the image back to the editor with a query string - then the editor will display the image, and when you save, the image will appear in the web page as normal. I can dig out the code if anyone wants any more details. Rich |
|
#6
|
|||
|
|||
|
hi ta6rma (rich)
I've read your suggestion (I'm working with PHP) but I don't understand what do you mean when you say "you close the new window & pass the url of the image back to the editor with a query string". Can you show the related code please |
|
#7
|
|||
|
|||
|
Hi Marc
I've done a version in both ASP and PHP so should be able to help you. In my editor, the 'insert image' button opens a new window containing a file upload field, the user browses for a file & uploads it. After a successful upload this code executes: header("Location:upload_done.php?src=".$uploadedfile_name); which sends the filename to a new page. This page is as follows: <html><head> <script language="javascript"> // get id of the uploaded image from query string... <?php echo "var imgSrc='".$HTTP_GET_VARS['src']."'";?> // ...pass url to the insert routine in the editor... opener.insertImage(imgSrc); // ...and close (return to the editor window) self.close(); </script></head><body></body></html> This calls the insertImage() function in the main editor window: function insertImage(imgName){ if (imgName !=null) { imgSrc = imgPath+imgName; doFormat('InsertImage', imgSrc); } } in my editor, doFormat() runs the execCommand functions. You will have to define the variable imgPath to point to your uploads directory. hope this helps Rich |
|
#8
|
|||
|
|||
|
Hi
ta6rma u have email ![]() I am interested in learning how to implement this in ASP. Many Thanks Allan |
|
#9
|
|||
|
|||
|
This is a great article, but I prefer htmlArea:
http://www.interactivetools.com/pro...index.html#demo And since this is open source and free, here you find all the add-ons: http://www.interactivetools.com/ifo...ea_Add-Ons_F19/ |
|
#10
|
|||
|
|||
|
Do you have an example of doing this in asp?
Can you post it? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > WYSIWYG Editor and Image Uploading |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|