>>>>> "RH" == Raghavendra Hegde <rag...@te...> writes:
RH> Hi,
RH> I am facing some problems while uploading a file.
RH> 1)
RH> Problem is that, when I upload a file, the uploaded file will always have 15 character extra.
From I see in your logs the problem is not that HTTP::WebTest adds
additional chars (they are ok) but that HTTP::WebTest generates
incorrect Content-Type header. I'll investigate what's wrong with it.
RH> 2) ALSO, Is there way to download file from web using HTTP::WEBTEST?
Well, technically it is possible. You can add on_response hook with
some Perl code to store HTTP response on disk. On the other hand I
think you just using wrong tool and you'd better just use
LWP::UserAgent.
*Untested example*
plugins = ( ::Hooks )
test_name = download file
url = ...
on_response = {
my $webtest = shift;
open FILE, '> /path/to/file';
print FILE $webtest->current_response->content;
close FILE;
[]
}
end_test
--
Ilya Martynov, il...@ip...
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|