CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Upload script?

 



NiGhTsPiRiT
Deleted

Oct 17, 2000, 2:57 AM

Post #1 of 2 (430 views)
Upload script? Can't Post

I have seen a lot of upload script. But always when I put the script on my server, I get an error. Does anyone know a good script?

Greetingz, NiGhTsPiRiT


perlkid
stranger

Oct 17, 2000, 9:54 PM

Post #2 of 2 (430 views)
Re: Upload script? [In reply to] Can't Post

 
Really can't remember where I found that upload.pl file, I looked here
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/File_Management/File_Uploading/

But nothing was familiar.

You may want to go through that list and look for one.

Also, maybe you are not configuring the scripts correctly. Do you know your path to perl, modules, and are you uploading in Ascii mode and chmoding your cgi files to 755?

Use this to determine your environments variables if you like.

Also, a lot of upload script use cgi-lib, and All use Cgi;, All I've seen anyway. Pretty sure you have to.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


#!/usr/bin/perl

##########################################################################
# Server Check 1.10 #
# #
# #
# Created: December 28, 1999 #
# Updated: February 09, 1999 #
# Copyright: 1999-2000 Virtual Solutions. All Rights Reserved #
# URL: http://www.monster-submit.com/scripts.html #
##########################################################################

#################
# Copyright Notice
#################
# Any redistribution of this script without the expressed written consent of Virtual Solutions is strictly prohibited.
# Copying any of the code contained within this script and claiming it as your own is also prohibited. You may not
# remove any of these header notices. By using this code you agree to indemnify Virtual Solutions from any liability
# that might arise from its use. The credit and link to Monster Scripts in the HTML output MUST be maintained.

#################
# Installation
#################
# 1. Rename servercheck.txt, servercheck.cgi
# 2. Upload to server in ASCII (text)
# 3. CHMOD script to 0755 (rwxr_xr_x)

########################################################
# Do NOT change or alter the code below! #
########################################################

print "Content-type: text/html\n\n";
print <<HTML;
<html>
<head>
<title>Server Check</title>
</head>

<body bgcolor="#FFFFFF" text="#000080" link="#800000" vlink="#0000FF" alink="#0000FF">

<center>
<table bgcolor="#000000" cellpadding="0" cellspacing="0" width="600" border="0">
<tr>
<th>
<table bgcolor="#000000" cellpadding="4" cellspacing="1" width="600" border="0">
<tr>
<th bgcolor="#000080"><font color="#FFFFFF">Server Check</th>
</tr>
<tr>
<th bgcolor="#FFFFFF">
<form>
<textarea name="" rows="10" cols="80">
HTML

print "Perl Version: $]\n\n";

$mail_prog = "/usr/lib/sendmail";
$result = &find_mail ($mail_prog);
if (! $result) {
$mail_prog = "/usr/sbin/sendmail";
$result = &find_mail ($mail_prog);
if (! $result) {
$mail_prog = "/var/qmail/bin/qmail-inject";
$result = &find_mail ($mail_prog);
if (! $result) { $mail_prog = "Unknown"; }
}
}

print "Server Mail Program Path: $mail_prog\n\n";

foreach $item (keys %ENV) { print "$item = $ENV{$item}\n";}
$curr_dir = `pwd`;
print "\nCurrent Directory: $curr_dir\n";

print "Installed Modules:\n";
print "==================\n";

use File::Find;
my (@mod, %done, $dir);

find (\&get_module, grep { -r and -d } @INC);
@mod = grep (!$done{$_}++, @mod);
foreach $dir (sort { length $b <=> length $a } @INC) {
foreach (@mod) { next if s,^\Q$dir,,; }
}
foreach (@mod) { s,^/(.*)\.pm$,$1,; s,/,::,g; print "$_\n"; }
print "\nNumber Modules Installed: $#mod";

print <<HTML;
</textarea>
</form>
</th>
</tr>
<tr>
<th bgcolor="#000080"><font color="#FFFFFF">
&copy; Copyright 1999-2000 Virtual Solutions. All Rights Reserved.</font></th>
</tr>
</table>
</th>
</tr>
</table>
</center>

</body>
</html>
HTML

exit;

########################################################
# Find Server Mail Program #
########################################################
sub find_mail {

my $path = shift (@_);

unless (-e "$path") { return 0; }
return 1;
}

########################################################
# Get Module #
########################################################
sub get_module {

/^.*\.pm$/ && /$ARGV[0]/i && push @mod, $File::Find::name;
}
exit;
</pre><HR></BLOCKQUOTE>

perlkid

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives