develooper Front page | perl.perl5.porters | Postings from April 2006

[perl #38828] Error in HTTP::DAV in perl language

Thread Next
From:
USaravanan
Date:
April 1, 2006 03:30
Subject:
[perl #38828] Error in HTTP::DAV in perl language
Message ID:
rt-3.0.11-38828-131803.4.42290580972852@perl.org
# New Ticket Created by  "USaravanan" 
# Please include the string:  [perl #38828]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38828 >


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>
http://localhost/virtual/server1.pl" METHOD="post"> 
<b>File 1</b>: &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/>
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. 

I am endeavour to implement WEBDAV method for uploading file/files with perl
as back end. The front page is constructed in html. We are trying to get
action from perl script. I have used HTTP::DAV and paste the same in
c:\perl\lib\ directory.

 

Could you recover or give exact solution for the above error which pasted
above.

 

Thanks and regards

Saravanan.U


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About