All My Brain Where stuff from my brain lands

February 16, 2009

Java upload handler for YUI Image Uploader

Filed under: Programming — Tags: , , , , — Dennis @ 7:36 am

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.

8 Comments »

  1. 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

    Comment by Chandra — September 7, 2009 @ 1:22 am

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

    Comment by Dennis — September 8, 2009 @ 12:25 pm

  3. 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.

    Comment by Chandra — September 16, 2009 @ 1:08 am

  4. 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.

    Comment by Vijay Oruganty — September 22, 2009 @ 10:42 am

  5. 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.

    Comment by Vijay Oruganty — September 22, 2009 @ 10:47 am

  6. […] Update 02/16/09: Vijay Oruganty has provided a Java upload handler for the YUI image uploader. […]

    Pingback by An Image Upload Extension for YUI Rich Text Editor | All My Brain — January 16, 2010 @ 3:45 am

  7. 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

    Comment by Aernoud — September 19, 2011 @ 2:33 am

  8. 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

    Comment by shiv — May 15, 2014 @ 12:20 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress

css.php
%d bloggers like this: