commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: [FileUpload] upload.parseRequest(request) failure
Date Sat, 11 Mar 2006 17:43:45 GMT
I think you just need to spend some time thinking about what you're doing
and debugging your code. A few comments:

* It now appears that the first sentence of your original message ("I have
installed java 1.5 on Windows 2000 platform.") is irrelevant, since you're
not using FileUpload on that machine anyway.

* Using FileUpload from within a JSP is not recommended. You should use a
servlet instead.

* You're setting the max size and the threshold to the same value, which
means everything will be retained in memory or rejected, yet you are
specifying a repository location, which will never be used in this scenario.

* You are assuming that all fields in the form are files. Any fields that
are not files (i.e. any other type of form field) will not have a file name,
so your code will fail for those.

--
Martin Cooper


On 3/11/06, Vineet Billorey <vineet.billorey@monsoonconsulting.com> wrote:
>
> Thanks for the reply.
>
> Please view the full jsp file attached with this mail.
>
> The file painting_small.jpg is stored in my windows 2000 Desktop.
> On server, I have a directory /var/www/icma/upload, where I want to store
> the file selected.
>
> Thanks in advance.
>
> Vineet Billorey
>
> ----- Original Message -----
> From: "Martin Cooper" <martinc@apache.org>
> To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> Sent: Friday, March 10, 2006 9:52 PM
> Subject: Re: [FileUpload] upload.parseRequest(request) failure
>
>
> On 3/10/06, Vineet Billorey <vineet.billorey@monsoonconsulting.com> wrote:
> >
> > OK. I tried this.
> >
> > But Sorry. Result was the same.
> >
> > Any new sugestion please?
>
>
> In your original message, you said you were running on Windows 2000. But
> the
> path you are trying to save to looks more like a Unix path, including
> Unix-style separators, and there is no drive letter specified. Try adding
> some temporary code, before the write(), to check that the directory is
> OK.
> For example:
>
>     File temp = new File(upload_path);
>     if (!(temp.exists() && temp.isDirectory())) {
>         // The path is your problem
>     }
>
> --
> Martin Cooper
>
>
> Thanks in ADVANCE.
> >
> > Vineet Billorey
> >
> > ----- Original Message -----
> > From: "Stephen Colebourne" <scolebourne@btopenworld.com>
> > To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> > Sent: Friday, March 10, 2006 2:30 PM
> > Subject: Re: [FileUpload] upload.parseRequest(request) failure
> >
> >
> > > Martin Cooper wrote:
> > > >>File saveTo = new File(upload_path+"/"+name);
> > >
> > > This should be considered a bug. You should be using:
> > > new File(upload_path, name);
> > > As the line separator character can vary by OS.
> > >
> > > Stephen
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >
> > > --
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date:
> 3/6/2006
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
>
>
>
>
> ----------------------------------------------------------------------------
> ----
>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message