Hi

I am trying to upload file using webDAV property in perl.

Front page using html

<html>
<head>
<title>WebDAV Tool</title>
</head>
<body bgcolor="#ffffcc">
<FORM ACTION="http://localhost/virtual/server1.pl"; METHOD="post"> 
File 1: &nbsp; <INPUT TYPE="file" NAME="file1" SIZE=40><br/>
<br/>
<table width="100%">
<tr>
<td width="25%">&nbsp;</td><td width="50%"><INPUT TYPE="submit"
name="Submit" value="SUBMIT"><br/>
</form>
</body>
</html>


Back end file server1.pl

use CGI;
use CGI::Carp qw(fatalsToBrowser);
use HTTP::DAV;

$d = new HTTP::DAV;

$url ="http://www.emantras.com/webdav2/";;

$d->credentials( -user=>"vijay", -pass =>"emantras", -url =>$url);

$d->open( -url=>"$url" )  || die("Couldn't open $url: " .$d->message .
"\n");

# $upload_dir = "d://perl_up"; 
 $upload_dir = "$url"."xdb1"; 

 $query = new CGI; 

 $filename = $query->param("file1"); 
# $email_address = $query->param("emailaddress"); 
 $filename =~ s/.*[\/\\](.*)/$1/;

  if ( $d->put( -local => "$filename", -url => $upload_dir))
  {
      print "successfully uploaded $filename to $upload_dir\n";
   }

  else
  {
      print "put failed: " . $d->message . "\n";
  }

  $d->unlock( -url => $upload_dir );

   print $query->header ( ); 
 print <<END_HTML 

 <HTML> 
 <HEAD> 
 <TITLE>Thanks!</TITLE> 
 </HEAD> 

<body bgcolor="#ffffcc">

 <P>Your file has been uploaded!</P> 

 </BODY> 
 </HTML> 
END_HTML
;

 

Error :

Software error:
Can't locate HTTP/DAV.pm in @INC (@INC contains: C:/Perl/lib
C:/Perl/site/lib .) at C:\Inetpub\wwwroot\virtual\server1.pl line 3.
BEGIN failed--compilation aborted at C:\Inetpub\wwwroot\virtual\server1.pl
line 3.

For help, please send mail to this site's webmaster, giving this error
message and the time and date of the error. 

Pls. give answer.


Thanks and regards

Saravanan.U

--
View this message in context: 
http://www.nabble.com/Error-in-perl-t1378484.html#a3701349
Sent from the Perl - ActivePerl forum at Nabble.com.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to