You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Till Nagel <ti...@netzministerium.de> on 2001/02/06 12:35:24 UTC

Cancel an upload form (Problem not solved yet)

Hi,

I didn't find a solution to the problem described below (forwarded message).


Currently the form and all its new data is stored, even if the user
canceled.
If the ActionServlet reads the cancel-Parameter from a multipart request,
the action would be able to cancel the storing process. But the file will be
uploaded though.

If I don't use the Struts cancel mechanism where should I delete the data
bean from the session?

Regards,
Till

----- Original Message -----
From: Till Nagel <ti...@netzministerium.de>
To: <st...@jakarta.apache.org>
Sent: Tuesday, January 16, 2001 6:51 PM
Subject: Cancel an upload form


> Hi,
>
> I've encountered a problem with forms supporting uploading files.
>
> These forms must include enctype="multipart/form-data" in their form-tag.
> The problem is that these multipart streams could be read just once.
> The ActionServlet populates the objectForm (i.e. reads the stream) and
next
> it tries to read the parameter Constants.CANCEL_PROPERTY from request. But
> it is always null.
> How could I solve this problem?
>
> Thanks for any advice.
>
> Regards,
> Till
>
>
>
>
>


RE: Cancel an upload form (Problem not solved yet)

Posted by Peter Doyle <pe...@teomedia.com>.
Hi,
 I'm currently faced with this problem. I'm uploading a zip file. My servelt
renames the file, unzips it then returns. All grand. The problem is if the
user presses cancel of there is some delay or file access issue, the files
become locked. When the user tries to repeat the procedure it cannot
succeed as the files are locked.

I am forced to restart my servlet container.

How can I ensure all files are closed/locks removed?
Can I detect the user cancel and erase the new files?

Thanks for any ideas,
Peter




-----Original Message-----
From: Till Nagel [mailto:till@netzministerium.de]
Sent: 06 February 2001 11:35
To: struts-user@jakarta.apache.org
Subject: Cancel an upload form (Problem not solved yet)


Hi,

I didn't find a solution to the problem described below (forwarded message).


Currently the form and all its new data is stored, even if the user
canceled.
If the ActionServlet reads the cancel-Parameter from a multipart request,
the action would be able to cancel the storing process. But the file will be
uploaded though.

If I don't use the Struts cancel mechanism where should I delete the data
bean from the session?

Regards,
Till

----- Original Message -----
From: Till Nagel <ti...@netzministerium.de>
To: <st...@jakarta.apache.org>
Sent: Tuesday, January 16, 2001 6:51 PM
Subject: Cancel an upload form


> Hi,
>
> I've encountered a problem with forms supporting uploading files.
>
> These forms must include enctype="multipart/form-data" in their form-tag.
> The problem is that these multipart streams could be read just once.
> The ActionServlet populates the objectForm (i.e. reads the stream) and
next
> it tries to read the parameter Constants.CANCEL_PROPERTY from request. But
> it is always null.
> How could I solve this problem?
>
> Thanks for any advice.
>
> Regards,
> Till
>
>
>
>
>