AW: [Webtest] Extension Field Usability: setFileField

webtest@lists.canoo.com webtest@lists.canoo.com
Tue, 12 Jul 2005 17:17:41 +0200


Hi,

i'm using the setFileField step and it seems to be working - almost.
I receive the filename ok, but the file is EMPTY.

e.g.=20
enter:   fileName=3D"import.csv"  (size=3D2KB)
receive: fileName=3D"import.csv"  (size=3D0)

On the page receiving the file i read in the parameters with:
import com.oreilly.servlet.multipart.MultipartParser;

MultipartParser multPart =3D new MultipartParser(request, 1024 * 1024 * =
8, true, true);
while ((part =3D multPart.readNextPart()) !=3D null) {
	if (part.isFile()) {
		FilePart filePart =3D (FilePart) part;
		String filename =3D filePart.getFileName().toLowerCase();
		if (filename.endsWith("csv") || filename.endsWith("xml")) {
			ByteArrayOutputStream baos_out =3D
				new ByteArrayOutputStream(8 * 1024 * 100);
			fileSize =3D filePart.writeTo(baos_out);
			String fileID =3D filePart.getName().toLowerCase();
		}
	}
}



By the way:
How can i change the log-level to debug?
I have a log4j.properties in my classpath and modified the line:

log4j.rootCategory=3Ddebug, stdout

but it doesn't work.


thanx
fritz.


> -----Urspr=FCngliche Nachricht-----
> Von: webtest-admin@lists.canoo.com=20
> [mailto:webtest-admin@lists.canoo.com] Im Auftrag von Marc Guillemot
> Gesendet: Dienstag, 12. Juli 2005 13:32
> An: webtest@lists.canoo.com
> Betreff: Re: [Webtest] Extension Field Usability: setFileField
>=20
> Hi,
>=20
> what are your "standards"? I use the setFileField without=20
> problem to upload images but a user (I think it was Lisa)=20
> already mentionned problems depending of the OS on which it=20
> was running.
>=20
> Marc.
>=20
> Jacob Portnoy wrote:
> > Hey all,
> > I was inquiring as to the usability of the setFileField=20
> step, which =20
> > is an extension step. I'm attempting to test a file upload=20
> feature of =20
> > one of our websites, and it appears as if when the file is=20
> uploaded, =20
> > it's not recognized as "valid" by our standards. Is the=20
> setFileField =20
> > step doing something unique that I should look into? Thanks=20
> in advance.
> >=20
> > -----------------
> > Jacob Portnoy
> > Checkerboard, Ltd.
> > JPortnoy@Checkernet.com
> >=20
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> >=20
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20