Java upload handler for YUI Image Uploader

Vijay Oruganty has been kind enough to provide a Java upload handler for the YUI Rich text image uploader.

I’ve attached the Eclipse project here.

Here is Vijay’s comments on the project:

[the attached file] has the whole eclipse project including the required libraries to build the project using ant. It has the compiled classes and the binary war (lib/ic_editor.war). The main java source (the upload handler) is iic_editor/src/com/hrbfa/iceditor/controller/RequestProcessor.java’,

Feel free to comment or ask questions about the project on this post.

This entry was posted in Programming and tagged , , , , . Bookmark the permalink.

8 Responses to Java upload handler for YUI Image Uploader

  1. Chandra says:

    Can anyway please send me an application where in which dynamic image uploader is used in a rich text editor using java please send me the code for the application asap.Thanks in advance

  2. Dennis says:

    I’m not sure what you are looking for here. Do you mean that you’d like a _client_ written in Java?

  3. Chandra says:

    Thanks for your reply Dennis
    I am a SE by profession.I’ve got to work on RichText Editor with image uploading feature.I’ve got the source code from vijay oruganty. but i’ve some problem with image uploading,the image is getting uploaded in my application context during run time but it is not rendering in the editor. when i debug the code Please give me any suggestion regarding this issue.

    I’ve found the problem over here
    ——————————-

    resp=r.responseText.replace( //i, ”).replace ( //i, ”);
    var o=eval(‘(‘+resp+’)’);
    if (o.status==’UPLOADED’) {
    Dom.get(‘insertimage_upload’).value=”;
    Dom.get(‘insertimage_url’).value=o.image_url;
    // tell the image panel the url changed
    // hack instead of fireEvent(‘blur’)
    // which for some reason isn’t working
    Dom.get(‘insertimage_url’).focus();
    Dom.get(‘insertimage_upload’).focus();

    the above code is from yui-image-uploader.js file
    which i’ve got with the eclipse application sent by vijay.

  4. Vijay Oruganty says:

    Chandra-
    From the description of the error you are getting I would check the lines 60 and 61 within RequestProcessor.java.

    60: String uploadFile = “images/” + fileName;
    61: out.println(“{status:’UPLOADED’,image_url:'” + uploadFile +”‘}”);

    If you are uploading an image say image1.jpg, you should be able to access the same at the URL /images/image1.jpg (which might look like http://images/image1.jpg). Make sure you are able to access the image at this URL and it would showup within the editor too. you may have to deploy your servlet in exploded mode and upload the image to a folder (say images) under your WebRoot or have your app server/web server render the images uploaded into the particular upload directory dynamically.

    Hope this helps.

    -Vijay.

  5. Vijay Oruganty says:

    Looks like the editor did not like the ‘greater than’ and ‘less than’ markups, so it took them out. I meant –

    …you should be able to access the same at the URL, Your_servlet_context/images/image1.jpg (which might look like http://host:port/your_servelt/images/image1.jpg).

    -Vijay.

  6. Pingback: An Image Upload Extension for YUI Rich Text Editor | All My Brain

  7. Aernoud says:

    Hi,
    I’m looking for a java/web programmer who can add a image upload and handling tool (resize, rotate, color change) to our site. Please contact me on arnismail@gmail.com for more details.

    Best regards,
    Aernoud

  8. shiv says:

    hi , i am use yui-image-uploader but not work script proper on this line
    resp=r.responseText.replace( //i, ”).replace ( //i, ”);
    my images upload but not set image url in image url text plz. help me

Comments are closed.