Re: Re: (nrd) LWP || HTML:: Request and Javascripts
by Sihal (Pilgrim) on Nov 05, 2002 at 13:49 UTC
|
All right now I get it.
Apparently, the Javascript updates the values of the parent window object (the parent's window form, wich is why I didn't see at first glance how to emulate the behavior in Perl).
So now that I know how the child frame js behaves, I'm able to emulate it in the parent ... (Dunno if it his clear).
Well at least now I know that there is a module that enables us to run embedded js code...
| [reply] |
|
|
OK, same node, different question:
I need now to upload a file: that is, I have an input tag, with the "file" type attribute.
The question being, how do I effectively upload the file? obiviously, if I enter just the path to the file, it won't work... (didn't try though, i'll do right away, what I tried was posting the whole file content)
| [reply] |
|
|
| [reply] |
|
|
Well I had a quick look at it yesterday before leaving, didn't find anything. I'll have a look right now, thanx.
| [reply] |
|
|
OK, this is how to do it.
POST 'http://www.perl.org/survey.cgi',
Content_Type => 'form-data',
Content => [ name => 'Gisle Aas',
email => 'gisle@aas.no',
gender => 'M',
born => '1964',
init => ["$ENV{HOME}/.profile"],
]
Sorry I didn't saw it yesterday, went too fast on it, didn't notice... All my apologies.
| [reply] [d/l] |
Re: Re: (nrd) LWP || HTML:: Request and Javascripts
by Sihal (Pilgrim) on Nov 05, 2002 at 13:42 UTC
|
Yes it helps... kinda. The trouble is I still faill to understand how that particular JS works, so I cannot emulate it in perl :(.
For info, there is a module called Javascript that enables you to execute embedded js code in a perl script.
I'm going to dissect the JS i'm working on before asking more questions, i'll keep you posted. | [reply] |
|
|
| [reply] |
|
|
thanx for the js, I figured it out.
thanx also for the feedback on the module, I was about to install it to see if it was worth it, but now I don't think I will... ;-)
| [reply] |
Re: Re: (nrd) LWP || HTML:: Request and Javascripts
by Sihal (Pilgrim) on Nov 06, 2002 at 15:38 UTC
|
OK. I have another problem with HTTP::Request::Common.
This time the problem is that my query always miss 2 characters in the end, that is: %0D%0A
(\r\n i reckon).
I noticed this using ethereal.
Trouble is, this request is exactly the same as the previous ones, ( except that it's not the same link of course) so I dunno why I have those 2 missing characters.. | [reply] [d/l] [select] |