[Helma-user] file upload monitoring

kRAkEn/gORe kunitoki at gmail.com
Fri Jun 15 17:52:01 CEST 2007


no i was rather mistaking things. i was getting empty form when doing
the progress get (obviously cause a simple periodical exeucter via
ajax was done), in the post all is working correctly. forget

with your example, i've got tried exceed maximum upload bytes
deliberately, but the overall response takes ages to come back to the
client so when doing periodical executions to get the progress they
takes 60-80 seconds to complete (with uploadSoftfail and checking for
req.data.helma_upload_error). i have something like this in my server
action class:

    initialize: function ()
    {
        this.parent ();

        if (req.data.helma_upload_error != undefined)
        {
            this.status = "MaxSizeReached";
            this.onResponse ();
        }
    },

	onAction: function ()
	{
        this.uploadDirectory = this.uploadDirectory || Config.getValue
("tempUploadDirectory");

        var status = session.getUploadStatus (req.data.upload_id);
        if (status != null)
        {
            this.upload = {
                current: status.current,
                total: status.total,
                itemsRead: status.itemsRead,
                error: status.error
            };
        }

        if (req.isPost())
        {
            if (status && status.getCurrent() == status.getTotal())
            {
                var files = this._saveAllFiles (status, this.uploadDirectory);

                this.onUploadCompleted (files);
            }
        }
        else if (status)
        {
            this.data = this.upload;
            this.status = "Progress";
        }
	}


but then the periodicalExecuter on the client takes ages to complete...




On 6/15/07, Hannes Wallnoefer <hannes at helma.at> wrote:
> Hi,
>
> 2007/6/15, kRAkEn/gORe <kunitoki at gmail.com>:
> > It seems that you can't put other form fields in the form while you
> > are uploading.
> > It returns status.itemsRead = the number of form elements... I need to have both
> > alphanumeric data and file upload with a single form submit. how can i do that ?
>
> sorry for the late reply, there were also some problems with the
> mailing list over the last few days, but they should be fixed now.
>
> Actually, mixing file input fields with other form elements should
> work without problems.  What exactly isn't working for you? Do you
> have a enctype="multipart/form-data" attribute in your form tag?
>
> hannes
>
> > thanx in advance
> >
> > On 6/5/07, Hannes Wallnoefer <hannes at helma.at> wrote:
> > > I've added a hook for file upload monitoring to the helma servlet: If
> > > there is a upload_id parameter in the query string, the upload status
> > > is tracked in the user's session. You can get it via
> > > session.getUploadStatus(uploadId). There's a demo page here:
> > >
> > > http://dev.helma.org/wiki/Upload+Demo/
> > >
> > > I think it doesn't work with Safari currently, maybe somebody can look
> > > into this.
> > >
> > > However, the really big news is that uploads are no longer passed in
> > > memory. helma.util.MimePart can now wrap a DiskFileItem from
> > > commons-fileupload, and you can read its content from an InputStream
> > > instead of a byte array. I'm in the process of documenting all this at
> > >
> > > http://dev.helma.org/wiki/HTTP+Parameter+and+File+Upload+Enhancements+in+Helma+1.6/
> > >
> > > hannes
> > >
> > > 2007/5/31, kRAkEn/gORe <kunitoki at gmail.com>:
> > > > already done
> > > >
> > > > On 5/31/07, Hannes Wallnoefer <hannes at helma.at> wrote:
> > > > > 2007/5/31, kRAkEn/gORe <kunitoki at gmail.com>:
> > > > > > cool,
> > > > > > since i'm basically quite new to helma, where should i look for
> > > > > > attaching this listener  to the common helma upload internal class,
> > > > > > and maybe let it trigger a session.onFileUploadProgress() found in the
> > > > > > application scripts ?
> > > > >
> > > > > It's rather hard to do this without modifying Helma, so I implemented
> > > > > it. It'll be in CVS later today.
> > > > >
> > > > > hannes
> > > > > _______________________________________________
> > > > > Helma-user mailing list
> > > > > Helma-user at helma.org
> > > > > http://helma.org/mailman/listinfo/helma-user
> > > > >
> > > > _______________________________________________
> > > > Helma-user mailing list
> > > > Helma-user at helma.org
> > > > http://helma.org/mailman/listinfo/helma-user
> > > >
> > > _______________________________________________
> > > Helma-user mailing list
> > > Helma-user at helma.org
> > > http://helma.org/mailman/listinfo/helma-user
> > >
> > _______________________________________________
> > Helma-user mailing list
> > Helma-user at helma.org
> > http://helma.org/mailman/listinfo/helma-user
> >
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
>


More information about the Helma-user mailing list