struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <dakota.j...@gmail.com>
Subject Re: DownloadAction Application
Date Mon, 07 Mar 2005 19:46:09 GMT
This is true with a proviso.  

While the stream has to be sent before it can be assessed generally,
which is not great, you can do a lot on the server side to manage
resources efficiently.

You can monitor the upload taking place, and, if you don't like the
size, reject it whenever you like.  You can also work from memory
before writing to xml, database, file, zip, etc.  The upload
application I have exhibited in part in the struts wiki shows this.

There is a lot in the commons fileupload package (thanks to Martin, I
think) which can assist in this regard.

Jack


On Mon, 7 Mar 2005 13:47:45 -0500, Slattery, Tim - BLS
<Slattery.Tim@bls.gov> wrote:
> > <2cents>
> > I would highly appreciate if an "upload" could determine the
> > size of the file before actually uploading it and reject the
> > file if it's larger then the given limit, to reduce traffic.
> 
> HTML/HTTP doesn't support that, IMHO. The <input type="file"...> tag just
> grabs the file and starts sending it. The server has no clue how large the
> file is until the entire thing arrives. (Remember the file and everything
> else in the form is transmitted as a single MIME-format stream.) And
> client-side script has no access to the client's file system, so you can't
> get the  size of the file that way.
> 
> --
> Tim Slattery
> Slattery_T@bls.gov
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message