Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
juaninnaio  
#1 Posted : Monday, December 6, 2010 2:28:30 PM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
I have my servlet:

Code:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import java.io.File;
import java.io.IOException;
import java.util.Hashtable;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.tomcat.util.http.fileupload.DiskFileUpload;
import org.apache.tomcat.util.http.fileupload.FileItem;
import org.apache.tomcat.util.http.fileupload.FileUploadException;

/**
 *
 * @author Juan Ignacio
 */
public class ImageUpload extends HttpServlet {
   
    /** 
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException, FileUploadException, Exception {

        //This variable specifies relative path to the folder, where the gallery
        //with uploaded files is located.

        String galleryPath = "/";

        //Process upload.
        ServletContext context = getServletContext();
        String absGalleryPath = context.getRealPath(galleryPath);
        String absThumbnailsPath = context.getRealPath(galleryPath + "/Thumbnails");
        String absTempPath = context.getRealPath(galleryPath + "/Temp");

        DiskFileUpload fu = new DiskFileUpload();
        //Set maximum size before a FileUploadException will be thrown.
        fu.setSizeMax(100000000);
        //Set maximum size that will be stored in memory.
        fu.setSizeThreshold(4096);
        //Set the location for saving data that is larger than getSizeThreshold().
        fu.setRepositoryPath(absTempPath);

        //Get uploaded files.
        List listFileItems = fu.parseRequest(request);

        //Put them in hash table for fast access.
        Hashtable fileItems = new Hashtable();

        for (int i = 0; i < listFileItems.size(); i++) {
            FileItem fileItem = (FileItem)(listFileItems.get(i));
            fileItems.put(fileItem.getFieldName(), fileItem);
        }

        //Get total number of uploaded files (all files are uploaded in a single package).
        int fileCount = Integer.parseInt(((FileItem) fileItems.get("FileCount")).getString());

        //Iterate through uploaded data and save the original file, thumbnail, and description.
        for (int i = 1; i <= fileCount; i++) {
            //Get source file and save it to disk.
            FileItem sourceFileItem = (FileItem) fileItems.get("SourceFile_" + Integer.toString(i));
            String fileName = new File(sourceFileItem.getName()).getName();
            File sourceFile = new File(absGalleryPath + File.separator + fileName);
            sourceFileItem.write(sourceFile);

            //Get first thumbnail (the single thumbnail in this code sample) and save it to disk.
            FileItem thumbnail1FileItem = (FileItem) fileItems.get("Thumbnail1_" + Integer.toString(i));
            File thumbnail1File = new File(absThumbnailsPath + File.separator + fileName + ".jpg");
            thumbnail1FileItem.write(thumbnail1File);
        }

    } 

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** 
     * Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        try {
            processRequest(request, response);
        } catch (FileUploadException ex) {
            Logger.getLogger(ImageUpload.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(ImageUpload.class.getName()).log(Level.SEVERE, null, ex);
        }
    } 

    /** 
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        try {
            processRequest(request, response);
        } catch (FileUploadException ex) {
            Logger.getLogger(ImageUpload.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(ImageUpload.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /** 
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}



And the call in JS in my JSP page:

Code:


<script type="text/javascript">
            var u = $au.uploader({
            id: 'Uploader1',
            width: '650px',
            height: '480px',
            licenseKey: 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX;YYYYY-YYYYY-YYYYY-YYYYY-YYYYY-YYYYYY',
            converters: [
                { mode: '*.*=SourceFile' },
                { mode: '*.*=Thumbnail;*.*=Icon', thumbnailFitMode: 'Fit', thumbnailWidth: '120', thumbnailHeight: '120' }
            ],
            uploadSettings: {
                actionUrl: 'ImageUpload',
                redirectUrl: 'bien.jsp'
            }
            });

            u.writeHtml();

        </script>



But when i upload the files i get a exception:

Code:


06-dic-2010 23:21:24 ImageUpload doGet
GRAVE: null
org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:255)
        at ImageUpload.processRequest(ImageUpload.java:58)
        at ImageUpload.doGet(ImageUpload.java:99)
        at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)
06-dic-2010 23:21:25 ImageUpload doPost
GRAVE: null
java.lang.NullPointerException
        at ImageUpload.processRequest(ImageUpload.java:69)
        at ImageUpload.doPost(ImageUpload.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)




The exception throw in the line:

Code:


//Get uploaded files.
List listFileItems = fu.parseRequest(request);



How can i fix this?? I need to solve this to buy a license and mount the image uploader in my web application.

Thanks!

Edited by user Monday, December 6, 2010 3:31:55 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Monday, December 6, 2010 9:24:33 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Juan,

Thanks for contacting us.

I have attached the archive with JSP sample application for your reference. Please download, and try it. Then please let me know about the results.
File Attachment(s):
JSP_ImageUploader7Demo.zip (2,609kb) downloaded 626 time(s).
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
juaninnaio on 12/8/2010(UTC)
juaninnaio  
#3 Posted : Tuesday, December 7, 2010 2:42:08 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Works fine Dmitri! Thanks!!

I will put this script in my web and then buy the express license!

Thanks again!
Dmitry.Obukhov  
#4 Posted : Tuesday, December 7, 2010 2:57:00 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Thanks for your comment.

If you have any additional questions please feel free to let me know.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
juaninnaio on 12/8/2010(UTC)
juaninnaio  
#5 Posted : Tuesday, December 7, 2010 3:06:22 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Yes, now i need to upload files but if a file whit the same name exists in the server rename the new file, and i dont need to upload source files, i want upload only 2 thumbnails, in two different sizes.

How can i do this?
Dmitry.Obukhov  
#6 Posted : Wednesday, December 8, 2010 12:28:31 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Juan,
  1. Quote:
    if a file whit the same name exists in the server rename the new file

    Unfortunately, it is impossible to rename files during uploading to the server, and saving them.
  2. Quote:
    i dont need to upload source files, i want upload only 2 thumbnails, in two different sizes.

    You should specify converters like in this code snippet
    Code:
    
    converters: [
                        { mode: '*.*=Thumbnail', thumbnailWidth: 300, thumbnailHeight: 300},
                        { mode: '*.*=Thumbnail', thumbnailWidth: 120, thumbnailHeight: 120 }
                    ],
    
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
juaninnaio on 12/8/2010(UTC)
juaninnaio  
#7 Posted : Wednesday, December 8, 2010 1:21:42 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
My code of upload.jsp whit the new name uploadAlrededores.jsp page in server:

Code:

<%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@page import="proyecto.*"%>
<%@ page import= "org.apache.log4j.Logger" %>
<%@page contentType="text/html" pageEncoding="UTF-8" language="java" import="java.io.*,java.util.*,javax.servlet.*,javax.servlet.http.*,org.apache.commons.fileupload.*,org.w3c.dom.*,org.w3c.dom.ls.*"%>
<%!

    //Path donde se guardarán las fotos
    String galleryPath = "FotosUploader/";
    String absGalleryPath;
    String absThumbnailsPath;
    String absTempPath;

    //Método para cambiar el nombre de una foto si ya existe el nombre de esta en disco. (No sobreescritura).
    String getSafeFileName(String fileName) {
        String newFileName = fileName;
        File file = new File(absThumbnailsPath + File.separator + newFileName);
        int j = 1;
        while (file.exists()) {
            newFileName = j + "_" + fileName;
            file = new File(absThumbnailsPath + File.separator + newFileName);
            j = j + 1;
        }
        return newFileName;
    }

    /*
    private void deleteFiles(String path) {
        File dir = new File(path);

        String[] dirList = dir.list();
        if (dirList != null) {
            for (int i = 0; i < dirList.length; i++) {
                File file = new File(path + File.separator + dirList[i]);
                if (file.isFile()) {
                    file.delete();
                }
            }
        }
    }
    */
%>
<%

    Logger logger = Logger.getLogger(this.getClass());

    try{
        logger.info("Entramos en update");
        if (request.getMethod().equals("POST")) {
            logger.info("Dentro del post");
            //Process request.
            ServletContext context = getServletContext();
            absGalleryPath = context.getRealPath(galleryPath);
            //absGalleryPath = "http://www.alojamientosvijilia.com/admin/" + galleryPath;
            absThumbnailsPath = absGalleryPath + "/Thumbs";
            absTempPath = absGalleryPath + "/Temp";
            logger.info("Path correctos");
            //First of all, clear files and data uploaded at previous time.

            //Delete source files.
            //deleteFiles(absGalleryPath);

            //Delete thumbnails.
            //deleteFiles(absThumbnailsPath);

            //NOTE: If you do not want to delete previously uploaded files, just
            //remove or comment out the code above.

            //Process upload.
            // Create a factory for disk-based file items
            FileItemFactory factory = new DiskFileItemFactory(10240, new File(absTempPath));
            logger.info("factory correcto");
            // Create a new file upload handler
            ServletFileUpload upload = new ServletFileUpload(factory);
            logger.info("upload correcto");
            // Parse the request
            List listFileItems = upload.parseRequest(request);
            logger.info("listFileItems correcto");
            //Put them in hash table for fast access.
            Hashtable fileItems = new Hashtable();

            for (int i = 0; i < listFileItems.size(); i++) {
                FileItem fileItem = (FileItem) (listFileItems.get(i));
                fileItems.put(fileItem.getFieldName(), fileItem);
            }
            logger.info("Despues del primer for");
            //Obtenemos el total de fotos subidas
            int fileCount = Integer.parseInt(((FileItem) fileItems.get("PackageFileCount")).getString());
            logger.info("fileCount: " + fileCount);
            //Iteramos por las fotos subidas y las vamos guardando en disco segun deseemos.
            for (int i = 0; i < fileCount; i++) {

                //Se obtiene la foto subida, con su tamaño completo. A no me interesa almacenarla.
                //FileItem sourceFileItem = (FileItem) fileItems.get("File0_" + Integer.toString(i));
                //String fileName = getSafeFileName(new File(sourceFileItem.getName()).getName());
                //File sourceFile = new File(absGalleryPath + File.separator + fileName);
                //sourceFileItem.write(sourceFile);

                //Se obtiene la descripcion insertada en la foto.
                String descripcion = ((FileItem) fileItems.get("Description_" + i)).getString();
                logger.info("Descripcion: " + descripcion);

                //Se obtiene la miniatura generada y se guarda en disco.
                FileItem thumbnail1FileItem = (FileItem) fileItems.get("File1_" + Integer.toString(i));
                String fileName = getSafeFileName(new File(thumbnail1FileItem.getName()).getName());
                logger.info("fileName: " + fileName);
                String fileNameFull1 = absThumbnailsPath + File.separator + fileName;
                logger.info("fileNameFull1: " + fileNameFull1);
                File thumbnail1File = new File(fileNameFull1);
                logger.info("File creado");
                thumbnail1FileItem.write(thumbnail1File);
                logger.info("Thumb1 OK");

                //Se obtiene la miniatura de la miniatura generada y se guarda en disco.
                FileItem thumbnail2FileItem = (FileItem) fileItems.get("File2_" + Integer.toString(i));
                String fileNameFull2 = absThumbnailsPath + File.separator + "t_" + fileName;
                File thumbnail2File = new File(fileNameFull2);
                thumbnail2FileItem.write(thumbnail2File);
                logger.info("Thumb2 OK");

                //Traza de mensajes para comprobar el funcionamiento.
                logger.info("********************** INSERT **********************");

                String seccion = request.getParameter("seccion");
                String subseccion = request.getParameter("subseccion");

                logger.info("SECCION: " + seccion);
                logger.info("SUBSECCION: " + subseccion);
                logger.info("THUMBAIL: " + fileNameFull2);
                logger.info("IMAGEN: " + fileNameFull1);
                logger.info("DESCRIPCION: " + descripcion);

                Imagen im = new Imagen();
                im.setSeccion(seccion);
                im.setSubseccion(subseccion);
                im.setThumbail(fileNameFull2);
                im.setImagen(fileNameFull1);
                im.setDescripcion(descripcion);

                ImagenFacade imF = new ImagenFacade();
                imF.insertarImagen(im);

                logger.info("******************** FIN INSERT ********************");
            }
        }
        logger.info("FIN");
    }catch(Exception ex){
        logger.info(ex.getMessage());
    }
%>



The script of ImageUploader:

Code:

<script type="text/javascript">

                                var uploader = $au.uploader({
                                    id: 'Uploader1',
                                    width: '590px',
                                    height: '600px',
                                    licenseKey: '76FF4-00400-00002-88D28-8DEEE-52A476',
                                    activeXControl: {
                                        codeBase: '../js/imageuploader/ImageUploader7.cab'
                                    },
                                    javaControl: {
                                        codeBase: '../js/imageuploader/ImageUploader7.jar'
                                    },
                                    uploadSettings: {
                                        actionUrl: 'uploadAlrededores.jsp',
                                        redirectUrl: 'adminAlrededores.jsp'
                                    },
                                    converters: [
                                        { mode: '*.*=SourceFile' },
                                        { mode: '*.*=Thumbnail', thumbnailWidth: 666, thumbnailHeight: 500 },
                                        { mode: '*.*=Thumbnail', thumbnailWidth: 120, thumbnailHeight: 80 }
                                    ],
                                    folderPane: {
                                        viewMode: 'Thumbnails',
                                        height: 370
                                    },
                                    uploadPane: {
                                        viewMode: 'List'
                                    },
                                    detailsViewColumns: {
                                        infoText: ''
                                    },
                                    paneItem: {
                                        showFileNameInThumbnailsView: true
                                    }
                                });
                                /*
                                var ip = $au.installationProgress(uploader);
                                ip.progressImageUrl('Images/installation_progress.gif');
                                ip.progressCssClass('ip-progress');
                                ip.instructionsCssClass('ip-instructions');
                                */
                                uploader.writeHtml();

                            </script>


When I upload a image the progress bar comes to 100% and the ImageUploader tell me that the process is complete and succesful. But when i go to directory is empty, the log:

Code:

11:02:06,024  INFO uploadAlrededores_jsp:112 - Entramos en update
11:02:06,025  INFO uploadAlrededores_jsp:114 - Dentro del post
11:02:06,025  INFO uploadAlrededores_jsp:121 - Path correctos
11:02:06,025  INFO uploadAlrededores_jsp:136 - factory correcto
11:02:06,026  INFO uploadAlrededores_jsp:139 - upload correcto
11:02:11,942  INFO uploadAlrededores_jsp:142 - listFileItems correcto
11:02:11,942  INFO uploadAlrededores_jsp:150 - Despues del primer for
11:02:11,943  INFO uploadAlrededores_jsp:153 - fileCount: 1
11:02:11,943  INFO uploadAlrededores_jsp:165 - Descripcion: 
11:02:11,943  INFO uploadAlrededores_jsp:170 - fileName: DSC_0320.JPG.jpg_Thumbnail1.jpg
11:02:11,943  INFO uploadAlrededores_jsp:172 - fileNameFull1: /mnt/redrocket_vhosts/alojamie/data/www/alojamientosvijilia.com/FotosUploader/Thumbs/DSC_0320.JPG.jpg_Thumbnail1.jpg
11:02:11,943  INFO uploadAlrededores_jsp:174 - File creado
11:02:11,943  INFO uploadAlrededores_jsp:212 - /mnt/redrocket_vhosts/alojamie/data/www/alojamientosvijilia.com/FotosUploader/Thumbs/DSC_0320.JPG.jpg_Thumbnail1.jpg (No such file or directory)


Im getting error "No such file or directory"... this error throws in line 111.

How can i fix this? What im doing wrong? The folder have 777 permission...

Edited by user Wednesday, December 8, 2010 2:16:59 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#8 Posted : Wednesday, December 8, 2010 2:52:29 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
  1. Could you try the original sample I provided you on your server? Then please let me know about the results.
  2. Please provide me with your complete sample applications. We will test it on our server.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
juaninnaio  
#9 Posted : Wednesday, December 8, 2010 8:04:46 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Hi Dmitri, i can´t try whit your sample because the server has a shared tomcat and i cant upload more of one app. But i have integrated your sample in my app and doesnt work...

Can i send you the war file to check if you can: http://www.e-j3n.com/dist.zip
I send you the password of zip file in private message.

The page is adminAlrededores.jsp, and the upload page is uploadAlrededores.jsp, are in admin folder.

Tell me if you need some more.

Thanks.
Dmitry.Obukhov  
#10 Posted : Thursday, December 9, 2010 3:56:54 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Juan,

Thanks for your application. We tested it with our technical engineer.

The problem was caused by incorrect path to the uploaded files. By some strange reason the path did not include admin/ folder. And the path looked like this: folder/folder/FotosUploader/. But it should be: folder/folder/admin/FotosUploader/. Our developer corrected your server-side script.
You should replace this string:
Code:
 String galleryPath = "FotosUploader/";

with this one:
Code:
 String galleryPath = "admin/FotosUploader/";

We tested it, and application worked for us perfectly. Images were uploaded and saved okay.

Also, we noted that you use three Image Uploaders with the same ID on the page. It would cause unpredictable behavior of Image Uploaders work. You should set different IDs for each Uploader.

If you have any additional questions or problems, please let me know.

Edited by user Thursday, December 9, 2010 3:57:56 AM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
juaninnaio  
#11 Posted : Thursday, December 9, 2010 4:02:28 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Im working now, when i leave to home i will try it and i will tell you results.

I will change the id´s too.

and... Thanks again!!
juaninnaio  
#12 Posted : Thursday, December 9, 2010 11:17:53 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Ok Dmitri, works fine!!

Now, i want to customize user interface, im reading the API but i dont understand how can i change color texts and header. Can you put a sample for this? and Can i show in Image Uploader control only the image files (jpg and png for example)?

I want to translate to spanish too, i understand that if i make a new js file like aurigma.uploader.en_localization.js but named aurigma.uploader.es_localization.js and with his texts translated to spanish, and then set the uploader to this file like this:

Code:
uploader.set(es_localization);


whit the file import in the head of my web works perfectly. Right?

And the last thing... when im uploading a pic with size 234 kb, the progress bar shows that my file have 5 Mb. Its a bug? or maybe is because i have a trial version yet?

Thanks again!

Edited by user Thursday, December 9, 2010 11:45:23 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#13 Posted : Saturday, December 11, 2010 12:20:17 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Sorry for the delayed answer.
  1. Here are links on JavaScript properties, which allows changing the colors of panes and text in three panes layout mode:
    - headerColor;
    - headerTextColor
    - auxiliaryTextColor
    - panelBorderColor
    - backgroundColor
    - textColor

    Please also read Customizing Appearance article to find detailed information on how to change color of panes.
  2. Quote:
    Can i show in Image Uploader control only the image files (jpg and png for example)?

    Yes, you just need to specify fileMask property:
    Code:
    
    $au.uploader({
        restrictions: {
            //...other params...
            fileMask: " *.jpg; *.png ",
            //...other params...
        }
    })
  3. As for Spanish localization question.

    You can use predefined localization.
    I attached file aurigma.uploader.es_localization.js with Spanish localization to this post.
    Please place it in the /Scripts folder then, do the following:
    1) Link the aurigma.uploader.es_localization.js file with the page where you configure an uploader object.
    2) Pass the es_localization object defined in this file to the uploader.set(Object) method.
    Code:
    <script type="text/javascript" src="Scripts/aurigma.uploader.js">  </script>
    <script type="text/javascript" src="Scripts/aurigma.uploader.es_localization.js">  </script>
    <script type="text/javascript">
    var uploader = $au.uploader({
        // Image Uploader configuration
    });
    uploader.set(es_localization);
    uploader.writeHtml();
    </script>

    I check it. It worked okay for me.

    Also, you can create your own localization. As far as I understand, you have done it. It is okay.
  4. Quote:
    when im uploading a pic with size 234 kb, the progress bar shows that my file have 5 Mb.

    I looked through your code:
    Code:
    
    converters: [
    { mode: '*.*=SourceFile' },
    { mode: '*.*=Thumbnail', thumbnailWidth: 666, thumbnailHeight: 500 },
    { mode: '*.*=Thumbnail', thumbnailWidth: 120, thumbnailHeight: 80 }],

    You upload source file and two thumbnails, but save two thumbnails only. Please remove source file converter, and just remain thumbnail converters:
    Code:
    
    converters: [
    { mode: '*.*=Thumbnail', thumbnailWidth: 666, thumbnailHeight: 500 },
    { mode: '*.*=Thumbnail', thumbnailWidth: 120, thumbnailHeight: 80 }],
If you have any additional questions or problems, please let me know.

Sorry for the delayed once again.
File Attachment(s):
aurigma.uploader.es_localization.zip (2kb) downloaded 17 time(s).
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
juaninnaio  
#14 Posted : Saturday, December 11, 2010 10:09:44 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Ok Dmitri, i have customized the component, setted the fileMask and translate it. But i can´t fix the problem of size while i´m uploading...

Im converters I have only two thumbnails now.

For example, i have a image whit 629 Kb:

UserPostedImage

while i´m uploading the component show the size remaining, and is showing 14 Mb!!

UserPostedImage

The uploading take more time because upload 14 Mb and not 629 Kb, but when the upload is complete i have the two thumbnails in the folder, all ok...

UserPostedImage

... but when i see the temp folder...

UserPostedImage

i have 23 files whit 629 Kb in temp folder!!

What happen? It´s very strange...

Thanks again :)
juaninnaio  
#15 Posted : Saturday, December 11, 2010 10:13:41 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
The code of the page:

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import= "proyecto.*" %>
<%@ page import= "java.util.*" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/cufon-yui.js"></script>
<script type="text/javascript" src="../js/Hand_Of_Sean_400.font.js"></script>
<script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../js/funciones.js"></script>
<script type="text/javascript" src="../js/prototype.js"></script>
<script type="text/javascript" src="../js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="../js/lightbox.js"></script>
<script type="text/javascript" src="../js/imageuploader/aurigma.uploader.js"></script>
<script type="text/javascript" src="../js/imageuploader/aurigma.uploader.installationprogress.js"></script>
<script type="text/javascript" src="../js/imageuploader/aurigma.uploader.es_localization.js"></script>
<script type="text/javascript">
 Cufon.replace('h1, h2');
</script>
<style type="text/css">.DownloadingScreenStyle {
    background-color:#f5f5f5;font-family:verdana;font-size:11px;padding:10px;text-align:center;color:#000000;
    }
</style>
<title>.: Alojamientos Vijilia :.</title>
<link rel="shortcut icon" href="../img/favicon.ico"/>
<%
try{
    String seccion = "alrededores";
    SeccionFacade sf = new SeccionFacade();
    Seccion alrededores = sf.obtenerSeccionPorNombre(seccion);

    String usuario = (String)session.getAttribute("usuario");
    String password = (String)session.getAttribute("password");
   //Comprobamos si la sesion no esta creada
   if ((usuario == null)&&(password == null)){
       //Si no hay sesion o es incorrecta mandamos a la pagina de error de identificacion
       session.invalidate();
       response.sendRedirect("errorIdentificacion.jsp");
   }else{
       //Si la sesion esta creada comprobamos los datos
       AdministradorFacade af = new AdministradorFacade();
       boolean identif = af.identificarAdministrador(usuario, password);
       if (identif == false){
           //Si no mandamos a la pagina de error de identificacion
           session.invalidate();
           response.sendRedirect("errorIdentificacion.jsp");
       }
   }
%>
</head>
<body>
	<div id="principalInicio">
		<jsp:include page="includes/adminLinks.jsp"/>
		<div id="tituloSeccionPrincipal">
                    <form action="../servlets/ModificarSecciones" method="POST">
                    <table align="left" width="60%">
                        <tr>
                            <td align="right" valign="center">
                                <input type="text" name="titulo" value="<%= alrededores.getTitulo() %>"/>
                                <input type="hidden" name="seccion" value="<%= alrededores.getSeccion() %>"/>
                                <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                            </td>
                            <td align="left" valign="center">
                                <input type="submit" class="boton" value="Modificar"/>
                            </td>
                        </tr>
                    </table>
                    </form>
		</div>
                <div id="seccionPrincipalAdmin" align="center">
                        <div id="cabeceraSeccionAdmin">
                            <form action="../servlets/ModificarSecciones" method="POST">
                            <table align="left" width="70%" border="0">
                                <tr>
                                    <td align="left" valign="center">
                                        <%if (alrededores.getTexto_cabecera() != null){%>
                                        <textarea name="cabecera" rows="6" cols="70"><%= alrededores.getTexto_cabecera() %></textarea>
                                        <%}else{%>
                                        <textarea name="cabecera" rows="6" cols="70"></textarea>
                                        <%}%>
                                        <input type="hidden" name="seccion" value="<%= alrededores.getSeccion() %>"/>
                                        <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                    </td>
                                    <td align="left" valign="center">
                                        <input type="submit" class="boton" value="Modificar"/>
                                    </td>
                                </tr>
                            </table>
                            </form>
                        </div>
                        <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
                        <%
                        //Carga de subsecciones
                        SubseccionFacade ssf = new SubseccionFacade();
                        List<Subseccion> lss = ssf.obtenerSubseccionesPorSeccion("alrededores");
                        Iterator it = lss.iterator();
                        int idUploader = 1;
                        while (it.hasNext()){
                            Subseccion ss = (Subseccion)it.next();
                        %>
			<div id="tituloNoticia">
                            <form action="../servlets/ModificarSecciones" method="POST">
                                <table align="left" width="40%" border="0">
                                <tr>
                                    <td align="left" valign="center">
                                        <input type='text' name='tituloSubseccion' value='<%= ss.getTitulo() %>' size="30"/>
                                        <input type="hidden" name="seccion" value="<%= ss.getSeccion() %>"/>
                                        <input type="hidden" name="subSeccion" value="<%= ss.getSubseccion() %>"/>
                                        <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                    </td>
                                    <td align="left" valign="center">
                                        <input type="submit" class="boton" value="Modificar"/>
                                    </td>
                                </tr>
                            </table>
                            </form>
			</div>
                        <br/><br/>
			<div id="noticiaTop"></div>
			<div id="noticiaCenter">
			<div id="textoNoticiaAdmin">
                            <form action="../servlets/ModificarSecciones" method="POST">
                            <table align="center" width="70%" border="0">
                                <tr>
                                    <td align="left" valign="center">
                                        <textarea name="textoSubSeccion" rows="8" cols="68"><%= ss.getTexto() %></textarea>
                                        <input type="hidden" name="seccion" value="<%= ss.getSeccion() %>"/>
                                        <input type="hidden" name="subSeccion" value="<%= ss.getSubseccion() %>"/>
                                        <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                    </td>
                                </tr>
                                    <tr>
                                        <td align="center" valign="center">
                                        <input type="submit" class="boton2" value="Modificar"/>
                                    </td>
                                </tr>
                            </table>
                            </form>
                            <br/><br/>
                            <form action="../servlets/NuevoYoutube" method="POST" onsubmit="return nuevoYoutube(document.forms[0].codigo.value, document.forms[0].ciudad.value, document.forms[0].email.value);">
                                <center><u><b>A&ntilde;adir nuevo v&iacute;deo de Youtube:</b></u></center>
                                <br/>
                                <table width="50%" align="center">
                                    <tr>
                                        <td align="right" valign="center"><b>C&oacute;digo:</b></td>
                                        <td align="center" valign="center"><input type="text" name="codigo" size="20" maxlength="255"/></td>
                                        <td align="left" valign="center">
                                            <input type="hidden" name="ciudad"/>
                                            <input type="hidden" name="email"/>
                                            <input type="hidden" name="seccion" value="<%= ss.getSeccion() %>"/>
                                            <input type="hidden" name="subseccion" value="<%= ss.getSubseccion() %>"/>
                                            <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                            <input type="submit" class="boton2" value="A&ntilde;adir"/>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                            <br/>
                            <%
                                //Carga de videos
                                YoutubeFacade yf = new YoutubeFacade();
                                List<Youtube> ly = yf.obtenerYoutube(seccion, ss.getSubseccion());
                                if (ly.size() > 0){
                            %>
                            <table width="100%" align="center">
                                <tr>
                                    <%
                                        int i = 0;
                                        int j = 1;
                                        while(i < ly.size()){
                                    %>
                                    <td width="20%" align="center" valign="center">
                                        <form action="../servlets/EliminarYoutube" method="POST" onsubmit="return confirmacionBorrarYoutube();">
                                            <table align="center" width="100%">
                                                <tr>
                                                    <td align="center">
                                                        <object width="275" height="225">
                                                        <param name="movie" value="http://www.youtube.com/v/<%= ly.get(i).getCodigo() %>&hl=es_ES&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1">
                                                        </param>
                                                        <param name="allowFullScreen" value="true">
                                                        </param>
                                                        <param name="allowscriptaccess" value="always">
                                                        </param>
                                                        <embed src="http://www.youtube.com/v/<%= ly.get(i).getCodigo() %>&hl=es_ES&fs=1&rel=0&color1=0x234900&color2=0x4e9e00&border=1"
                                                        type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="275" height="225">
                                                        </embed>
                                                        </object>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                                        <input type="hidden" name="id" value="<%= ly.get(i).getId() %>"/>
                                                        <input type="submit" class="boton2" value="Eliminar"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                    </td>
                                    <%
                                        i++;
                                        j++;
                                        if (j == 3){
                                            j = 1;
                                    %>
                                    </tr>
                                    <tr>
                                    <%
                                        }}
                                    %>
                                </tr>
                            </table>
                            <%
                                }
                            %>
                            <br/>
                            <%-- Insercion de imagenes antigua
                            <form action="../servlets/NuevaImagen" method="POST" onsubmit="return nuevaImagen(document.forms[0].descripcion.value, document.forms[0].url.value, document.forms[0].thumbail.value, document.forms[0].ciudad.value, document.forms[0].email.value);">
                                <center><u><b>A&ntilde;adir nueva Imagen:</b></u></center>
                                <table width="80%" align="center">
                                    <tr>
                                        <td align="right" valign="center"><b>Descripci&oacute;n:</b></td>
                                        <td align="left" valign="center"><input type="text" name="descripcion" size="70" maxlength="255"/></td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="center"><b>URL:</b></td>
                                        <td align="left" valign="center"><input type="text" name="url" size="70" maxlength="255"/></td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="center"><b>Thumbail:</b></td>
                                        <td align="left" valign="center"><input type="text" name="thumbail" size="70" maxlength="255"/></td>
                                    </tr>
                                </table>
                                <input type="hidden" name="ciudad"/>
                                <input type="hidden" name="email"/>
                                <input type="hidden" name="seccion" value="<%= ss.getSeccion() %>"/>
                                <input type="hidden" name="subseccion" value="<%= ss.getSubseccion() %>"/>
                                <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                <center><input type="submit" class="boton2" value="A&ntilde;adir"/></center>
                            </form>--%>
                            <br/>
                            <center><u><b>A&ntilde;adir im&aacute;genes:</b></u></center>
                            <br/>
                            <script type="text/javascript">

                                var uploader = $au.uploader({
                                    id: 'Uploader<%= idUploader %>',
                                    width: '590px',
                                    height: '600px',
                                    headerTextColor: "#000000",
                                    headerColor: "#F8FAC6",
                                    licenseKey: '76FF4-00400-00002-88D28-8DEEE-52A476',
                                    restrictions: {
                                        fileMask: " *.jpg; *.jpeg; *.gif; *.png "
                                    },
                                    activeXControl: {
                                        codeBase: '../js/imageuploader/ImageUploader7.cab'
                                    },
                                    javaControl: {
                                        codeBase: '../js/imageuploader/ImageUploader7.jar'
                                    },
                                    uploadSettings: {
                                        actionUrl: 'uploadAlrededores.jsp?seccion=<%= ss.getSeccion().replace(" ", "_") %>&subseccion=<%= ss.getSubseccion().replace(" ", "_") %>',
                                        redirectUrl: 'adminAlrededores.jsp'
                                    },
                                    converters: [
                                        //{ mode: '*.*=SourceFile' }, // No le mando la foto completa porque no me interesa
                                        { mode: '*.*=Thumbnail', thumbnailWidth: 666, thumbnailHeight: 500 },
                                        { mode: '*.*=Thumbnail', thumbnailWidth: 120, thumbnailHeight: 80 }
                                    ],
                                    folderPane: {
                                        viewMode: 'Thumbnails',
                                        height: 370
                                    },
                                    uploadPane: {
                                        viewMode: 'List'
                                    },
                                    detailsViewColumns: {
                                        infoText: ''
                                    },
                                    paneItem: {
                                        showFileNameInThumbnailsView: true
                                    }
                                });
                                
                                var ip = $au.installationProgress(uploader);
                                ip.progressHtml('<p><br /><br /><br /><img src=\"{0}\" /><br /><br /><br />Accediendo al cargador de imagenes...</p>');
                                ip.progressImageUrl('installation_progress.gif');
                                ip.progressCssClass('DownloadingScreenStyle');

                                uploader.set(es_localization);
                                uploader.writeHtml();

                            </script>
                            <br/><br/>
                            <%
                                //Carga de imágenes
                                ImagenFacade imf = new ImagenFacade();
                                List<Imagen> li = imf.obtenerImagenes(seccion, ss.getSubseccion());
                                if (li.size() > 0){
                            %>
                            <table width="100%" align="center">
                                <tr>
                                    <%
                                        int i = 0;
                                        int j = 1;
                                        while(i < li.size()){
                                    %>
                                    <td width="20%" align="center" valign="center">
                                        <form action="../servlets/EliminarImagen" method="POST" onsubmit="return confirmacionBorrarImagen();">
                                            <table align="center" width="100%">
                                                <tr>
                                                    <td align="center">
                                                        <a href="<%= li.get(i).getImagen() %>" rel="lightbox" title="<%= li.get(i).getDescripcion() %>"><img src="<%= li.get(i).getThumbail() %>" style="border:1px solid black;"/></a>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <input type="hidden" name="pagina" value="admin/adminAlrededores.jsp"/>
                                                        <input type="hidden" name="id" value="<%= li.get(i).getId() %>"/>
                                                        <input type="submit" class="boton2" value="Eliminar"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                    </td>
                                    <%
                                        i++;
                                        j++;
                                        if (j == 5){
                                            j = 1;
                                    %>
                                    </tr>
                                    <tr>
                                    <%
                                        }}
                                    %>
                                </tr>
                            </table>
                            <%
                                }
                            %>
			</div>
			</div>
			<div id="noticiaBottom"></div>
                        <%
                        if (it.hasNext()){
                        %>
			<br/>
                        <%}

                        idUploader++;
                        }%>
		</div>
		<div id="clear">
			<br/><br/><br/>
		</div>
		<jsp:include page="includes/adminPie.jsp"/>
	</div>
</body>
</html>
<%
}catch(Exception ex){
    response.sendRedirect("error.jsp");
}
%>



The code of upload page:

Code:

<%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@page import="proyecto.*"%>
<%@ page import= "org.apache.log4j.Logger" %>
<%@page contentType="text/html" pageEncoding="UTF-8" language="java" import="java.io.*,java.util.*,javax.servlet.*,javax.servlet.http.*,org.apache.commons.fileupload.*,org.w3c.dom.*,org.w3c.dom.ls.*"%>
<%!

    //Path donde se guardarán las fotos
    String galleryPath = "admin/FotosUploader/";
    String absGalleryPath;
    String absThumbnailsPath;
    String absTempPath;

    //Método para cambiar el nombre de una foto si ya existe el nombre de esta en disco. (No sobreescritura).
    String getSafeFileName(String fileName) {
        String newFileName = fileName;
        File file = new File(absThumbnailsPath + File.separator + newFileName);
        int j = 1;
        while (file.exists()) {
            newFileName = j + "_" + fileName;
            file = new File(absThumbnailsPath + File.separator + newFileName);
            j = j + 1;
        }
        return newFileName;
    }
%>
<%

    Logger logger = Logger.getLogger(this.getClass());

    try{

        if (request.getMethod().equals("POST")) {

            //Process request.
            ServletContext context = getServletContext();
            absGalleryPath = context.getRealPath(galleryPath);
            absThumbnailsPath = absGalleryPath + "/alrededores";
            absTempPath = absGalleryPath + "/temp";
            logger.debug("Path correctos");

            //Creamos el objeto factory
            FileItemFactory factory = new DiskFileItemFactory(10240, new File(absTempPath));
            logger.debug("factory correcto");

            ServletFileUpload upload = new ServletFileUpload(factory);
            logger.debug("upload correcto");

            List listFileItems = upload.parseRequest(request);
            logger.debug("listFileItems correcto");

            Hashtable fileItems = new Hashtable();

            for (int i = 0; i < listFileItems.size(); i++) {
                FileItem fileItem = (FileItem) (listFileItems.get(i));
                fileItems.put(fileItem.getFieldName(), fileItem);
            }

            logger.debug("Despues del primer for");

            //Obtenemos el total de fotos subidas
            int fileCount = Integer.parseInt(((FileItem) fileItems.get("PackageFileCount")).getString());
            logger.debug("fileCount: " + fileCount);

            //Iteramos por las fotos subidas y las vamos guardando en disco segun deseemos.
            for (int i = 0; i < fileCount; i++) {

                //Se obtiene la foto subida, con su tamaño completo. A no me interesa almacenarla.
                //FileItem sourceFileItem = (FileItem) fileItems.get("File0_" + Integer.toString(i));
                //String fileName = getSafeFileName(new File(sourceFileItem.getName()).getName());
                //File sourceFile = new File(absGalleryPath + File.separator + fileName);
                //sourceFileItem.write(sourceFile);

                //Se obtiene la descripcion insertada en la foto.
                String descripcion = ((FileItem) fileItems.get("Description_" + i)).getString();
                descripcion = descripcion.replace("ñ","&ntilde").replace("á","&aacute").replace("é","&eacute").replace("í","&iacute").replace("ó","&oacute").replace("ú","&uacute");
                descripcion = descripcion.replace("Ñ","&Ntilde").replace("Á","&Aacute").replace("É","&Eacute").replace("Í","&Iacute").replace("Ó","&Oacute").replace("Ú","&Uacute");
                logger.debug("Descripcion: " + descripcion);

                //Se obtiene la miniatura generada y se guarda en disco.
                FileItem thumbnail1FileItem = (FileItem) fileItems.get("File0_" + Integer.toString(i));
                String fileName = getSafeFileName(new File(thumbnail1FileItem.getName()).getName());

                logger.debug("fileName: " + fileName);
                String imagen = absThumbnailsPath + File.separator + fileName;
                File thumbnail1File = new File(imagen);
                logger.debug("File creado");
                thumbnail1FileItem.write(thumbnail1File);
                logger.debug("Thumb1 OK");

                //Se obtiene la miniatura de la miniatura generada y se guarda en disco.
                FileItem thumbnail2FileItem = (FileItem) fileItems.get("File1_" + Integer.toString(i));
                String thumb = absThumbnailsPath + File.separator + "t_" + fileName;
                File thumbnail2File = new File(thumb);
                thumbnail2FileItem.write(thumbnail2File);
                logger.debug("Thumb2 OK");

                //Traza de mensajes para comprobar el funcionamiento.
                logger.debug("********************** INSERT **********************");

                logger.debug("Path absoluto disco: " + absGalleryPath);

                String pathBD = "http://www.alojamientosvijilia.com/admin/FotosUploader";

                logger.debug("Path absoluto BD: " + pathBD);

                thumb = thumb.replace(absGalleryPath, pathBD);
                imagen = imagen.replace(absGalleryPath, pathBD);

                String seccion = request.getParameter("seccion");
                String subseccion = request.getParameter("subseccion").replace("_", " ");

                logger.debug("SECCION: " + seccion);
                logger.debug("SUBSECCION: " + subseccion);
                logger.debug("THUMBAIL: " + thumb);
                logger.debug("IMAGEN: " + imagen);
                logger.debug("DESCRIPCION: " + descripcion);

                Imagen im = new Imagen();
                im.setSeccion(seccion);
                im.setSubseccion(subseccion);
                im.setThumbail(thumb);
                im.setImagen(imagen);
                im.setDescripcion(descripcion);

                ImagenFacade imF = new ImagenFacade();
                logger.debug("Objeto imagen creado, vamos a insertar.");
                imF.insertarImagen(im);

                logger.debug("******************** FIN INSERT ********************");
            }
        }
        
        logger.debug("FIN");

    }catch(Exception ex){
        logger.debug(ex.getMessage());
    }
%>



I´m using 3 uploaders in the same page, with diferents id´s.
Dmitry.Obukhov  
#16 Posted : Monday, December 13, 2010 12:43:32 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

We with our developer tested your site, and found that the count of converters is equal to 25 (2 thumbnails and 23 extra ones). Then we looked though the list of used libraries. You use prototype.js file. It is a known problem with using this library. It adds extra converters while uploading. Thus, you experienced this problem.
This issue has been already fixed. I attached fixed aurigma.uploader.js file to the post. Please download it, and replace your old this file with the new one. The next release of Image Uploader 7 will be free of this issue.

Sorry for the inconvenience.

If you have any questions or problems, I will be glad to assist you.
File Attachment(s):
aurigma.uploader.zip (31kb) downloaded 15 time(s).
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
juaninnaio  
#17 Posted : Monday, December 13, 2010 3:33:33 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Thanks Dmitri, the upload size is now working for me.

I think i´m ready to buy the express license Dancing

I have a last question for you, sometimes the uploader crash in Mozilla Firefox, i can see the loading component but never load and the browser show me a message to stop the script... Why?

In Chrome or IE works fine...

Regards.
Dmitry  
#18 Posted : Tuesday, December 14, 2010 4:19:50 AM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

We need additional information on this problem. Could you please make a screenshot of Firefox browser right after the problem is reproduced and get content of Java console? As soon as they are ready, post them here in the forum thread.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
juaninnaio  
#19 Posted : Saturday, December 18, 2010 3:46:40 AM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Now appears to work fine... if i have some problem in the future i tell you.

Thanks again Dmitri.
juaninnaio  
#20 Posted : Saturday, December 18, 2010 1:46:13 PM(UTC)
juaninnaio

Rank: Member

Groups: Member
Joined: 12/6/2010(UTC)
Posts: 20

Thanks: 6 times
Hi Dmitri, im uploading some pics after crop, but the change not appear in the uploaded image. Why?
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.