Dear monks,

I'm not a religious type of guy but hey i tend to be perl-insh ;).

I'm trying to add Web Dav and SFTP into my cross-platform perl backup program (simplebackup - http://migas.kicks-ass.org/index.php?pag=en.myapps&subpag=simplebackup )

But i'm having problems in SFTP and HTTP::DAV...
any way this post is only related to HTTP::DAV problem.

I can upload/backup/put but i can't make downloads/restore/get to work.
Info:
Windows XP SP2
Using ActiveState Perl 5.8.8
http::dav 0.3.1
libxml perl 0.08
XML-DOM 1.44
XML-RegExp 0.03

My problem... basicly the program blows up with this error

get:http://localhost:8080/webdav/teste.rar -> C:\teste.rar

no element found at line 1, column 0, byte -1 at c:/Perl/lib/XML/Parser.pm line 187

Sample Code that i use.

Here is my sample code...
.... (code up including use strict;)
my $special_error_flag = 0; my $network_connection_p= new HTTP::DAV; # create the web dav object $network_connection_p-> DebugLevel(2); $network_connection_p-> credentials( -user=>"someuser",-pass => "somepass", -url =>"http://localhost:8080/webdav" ); $network_connection_p-> open( -url=>"http://localhost:8080/webdav") or $special_error_flag = 1; # attempt to open a connection into the web dav server if ( $special_error_flag == 1 ) { # check if we manage to connect print "failed connecting into web dav server } my $from_file = "http://localhost:8080/webdav/teste.rar"; my $to_file_tmp = "c:\\teste_file.rar"; # with relative paths this also fails #my $to_file_tmp = "teste_file.rar"; if ( !$network_connection-> get( -url=>"$from_file", -to=>"$to_file_tm +p" ) ) { print "download failed\n"; } else { print "download worked\n"; }

Any help would be greatefull !

Migas - Miguel

In reply to Using HTTP::DAV by migas

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.