You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Vineet Billorey <vi...@monsoonconsulting.com> on 2006/03/10 07:10:35 UTC
Re:[FileUpload] upload.parseRequest(request) failure
OK.
It crosses this step when I included org.apache.commons.io.1.1.jar
But it stops at another line as follows:
File saveTo = new File(upload_path+"/"+name);
item.write(saveTo);
Showing the following Exception:
java.io.FileNotFoundException: /var/www/icma/upload/painting_small.jpg (No
such file or directory)
Please consider that /var/www/icma/upload is the server path and the file
name is:painting_small.jpg
Please guide me.
Thanking you,
Vineet Billorey
----- Original Message -----
From: "Brian K. Wallace" <br...@transmorphix.com>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Thursday, March 09, 2006 1:45 PM
Subject: Re: upload.parseRequest(request) failure
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Vineet Billorey wrote:
> > I have installed java 1.5 on Windows 2000 platform.
> > I am using commons-fileupload1.1.jar and when I call the following
command
> >
> > List items = upload.parseRequest(request);
> >
> > It fails giving the following error:
> >
> > java.lang.NoClassDefFoundError:
org/apache/commons/io/output/DeferredFileOutputStream
> >
> > Please guide me.
> >
> > Thanks in advance.
> >
> >
> > Vineet Billorey
>
> You may also want to look at
> http://jakarta.apache.org/commons/fileupload/faq.html#class-not-found
>
> Brian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (MingW32)
>
> iD8DBQFED+QoaCoPKRow/gARApuSAKCzKy7kn8cPlJ+pfinZq784G++OLQCgpFIO
> /FeRvcLWqsolWUPVz4fsvmU=
> =T7rf
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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
Re: [FileUpload] upload.parseRequest(request) failure
Posted by Martin Cooper <ma...@apache.org>.
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 <vi...@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" <ma...@apache.org>
> To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> Sent: Friday, March 10, 2006 9:52 PM
> Subject: Re: [FileUpload] upload.parseRequest(request) failure
>
>
> On 3/10/06, Vineet Billorey <vi...@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" <sc...@btopenworld.com>
> > To: "Jakarta Commons Users List" <co...@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
>
>
>
Re: [FileUpload] upload.parseRequest(request) failure
Posted by Vineet Billorey <vi...@monsoonconsulting.com>.
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" <ma...@apache.org>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Friday, March 10, 2006 9:52 PM
Subject: Re: [FileUpload] upload.parseRequest(request) failure
On 3/10/06, Vineet Billorey <vi...@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" <sc...@btopenworld.com>
> To: "Jakarta Commons Users List" <co...@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
Re: [FileUpload] upload.parseRequest(request) failure
Posted by Martin Cooper <ma...@apache.org>.
On 3/10/06, Vineet Billorey <vi...@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" <sc...@btopenworld.com>
> To: "Jakarta Commons Users List" <co...@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
>
>
Re: [FileUpload] upload.parseRequest(request) failure
Posted by Vineet Billorey <vi...@monsoonconsulting.com>.
OK. I tried this.
But Sorry. Result was the same.
Any new sugestion please?
Thanks in ADVANCE.
Vineet Billorey
----- Original Message -----
From: "Stephen Colebourne" <sc...@btopenworld.com>
To: "Jakarta Commons Users List" <co...@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
Re: [FileUpload] upload.parseRequest(request) failure
Posted by Stephen Colebourne <sc...@btopenworld.com>.
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
Re: [FileUpload] upload.parseRequest(request) failure
Posted by Martin Cooper <ma...@apache.org>.
On 3/9/06, Vineet Billorey <vi...@monsoonconsulting.com> wrote:
>
> OK.
>
> It crosses this step when I included org.apache.commons.io.1.1.jar
>
> But it stops at another line as follows:
>
> File saveTo = new File(upload_path+"/"+name);
> item.write(saveTo);
>
> Showing the following Exception:
>
> java.io.FileNotFoundException: /var/www/icma/upload/painting_small.jpg (No
> such file or directory)
>
> Please consider that /var/www/icma/upload is the server path and the file
> name is:painting_small.jpg
And the path /var/www/icma/upload already exists on the server?
--
Martin Cooper
Please guide me.
>
> Thanking you,
>
> Vineet Billorey
>
>
> ----- Original Message -----
> From: "Brian K. Wallace" <br...@transmorphix.com>
> To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> Sent: Thursday, March 09, 2006 1:45 PM
> Subject: Re: upload.parseRequest(request) failure
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Vineet Billorey wrote:
> > > I have installed java 1.5 on Windows 2000 platform.
> > > I am using commons-fileupload1.1.jar and when I call the following
> command
> > >
> > > List items = upload.parseRequest(request);
> > >
> > > It fails giving the following error:
> > >
> > > java.lang.NoClassDefFoundError:
> org/apache/commons/io/output/DeferredFileOutputStream
> > >
> > > Please guide me.
> > >
> > > Thanks in advance.
> > >
> > >
> > > Vineet Billorey
> >
> > You may also want to look at
> > http://jakarta.apache.org/commons/fileupload/faq.html#class-not-found
> >
> > Brian
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.5 (MingW32)
> >
> > iD8DBQFED+QoaCoPKRow/gARApuSAKCzKy7kn8cPlJ+pfinZq784G++OLQCgpFIO
> > /FeRvcLWqsolWUPVz4fsvmU=
> > =T7rf
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > 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
>
>
Re: [FileUpload] upload.parseRequest(request) failure Jakarta.apache.org
Posted by Vineet Billorey <vi...@monsoonconsulting.com>.
Yes.(Sorry for 10 days delay in answer, as I was involved in another
project).
The path /var/www/icma/upload already exists on the server.
Kindly guide me.
Vineet Billorey
----- Original Message -----
From: "Martin Cooper" <ma...@apache.org>
To: <jb...@jezzper.dk>
Cc: "Vineet Billorey" <vi...@monsoonconsulting.com>
Sent: Tuesday, March 14, 2006 5:36 PM
Subject: Re: [FileUpload] upload.parseRequest(request) failure
Jakarta.apache.org
On 3/9/06, Vineet Billorey <vi...@monsoonconsulting.com> wrote:
>
> OK.
>
> It crosses this step when I included org.apache.commons.io.1.1.jar
>
> But it stops at another line as follows:
>
> File saveTo = new File(upload_path+"/"+name);
> item.write(saveTo);
>
> Showing the following Exception:
>
> java.io.FileNotFoundException: /var/www/icma/upload/painting_small.jpg (No
> such file or directory)
>
> Please consider that /var/www/icma/upload is the server path and the file
> name is:painting_small.jpg
And the path /var/www/icma/upload already exists on the server?
--
Martin Cooper
Please guide me.
>
> Thanking you,
>
> Vineet Billorey
>
>
> ----- Original Message -----
> From: "Brian K. Wallace" <br...@transmorphix.com>
> To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> Sent: Thursday, March 09, 2006 1:45 PM
> Subject: Re: upload.parseRequest(request) failure
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Vineet Billorey wrote:
> > > I have installed java 1.5 on Windows 2000 platform.
> > > I am using commons-fileupload1.1.jar and when I call the following
> command
> > >
> > > List items = upload.parseRequest(request);
> > >
> > > It fails giving the following error:
> > >
> > > java.lang.NoClassDefFoundError:
> org/apache/commons/io/output/DeferredFileOutputStream
> > >
> > > Please guide me.
> > >
> > > Thanks in advance.
> > >
> > >
> > > Vineet Billorey
> >
> > You may also want to look at
> > http://jakarta.apache.org/commons/fileupload/faq.html#class-not-found
> >
> > Brian
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.5 (MingW32)
> >
> > iD8DBQFED+QoaCoPKRow/gARApuSAKCzKy7kn8cPlJ+pfinZq784G++OLQCgpFIO
> > /FeRvcLWqsolWUPVz4fsvmU=
> > =T7rf
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > 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.385 / Virus Database: 268.2.5/284 - Release Date: 3/17/2006
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org