View previous topic :: View next topic |
Author |
Message |
ozzy214 -
Joined: 31 Mar 2006 Posts: 66
|
Posted: Sat Apr 01, 2006 7:34 pm Post subject: Upload script failure |
|
|
I keep getting this error with a perl uploader script. What tweaks can I get it to run?
CGI.pm: Server closed socket during multipart read (client aborted?). |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun Apr 02, 2006 1:43 pm Post subject: Re: Upload script failure |
|
|
ozzy214,
What is the script name/download URL? Have you tried increasing the CGI Timeout value in Abyss Web Server (useful if the uploaded file is large and the connection is not very fast)? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
ozzy214 -
Joined: 31 Mar 2006 Posts: 66
|
Posted: Sun Apr 02, 2006 2:14 pm Post subject: |
|
|
It is fap which is full album mod for phbb. It uses nuffloader to upload the pics to the album and nuff is a cgi script.
It can be downloaded from http://www.mightygorgon.com/viewtopic.php?t=2553
Nuffloader was based on Radith's megaupload perl script
Hope this is enuff info....will try the timeout, but I doubt that's it. Since Im only uploading a pic about 3000 k |
|
Back to top |
|
|
ozzy214 -
Joined: 31 Mar 2006 Posts: 66
|
Posted: Sun Apr 02, 2006 5:05 pm Post subject: |
|
|
# Author : Nuffmon 2005
# http://www.nuffmon.oftheweek.de
# Version 1.4.2
# Last Update 19/11/2005
#
# The Initial Developer of the Original Code is Raditha Dissanayake.
# Portions created by Raditha are Copyright (C) 2003
# Raditha Dissanayake. All Rights Reserved.
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $qstring = "";
if (length ($ENV{'QUERY_STRING'}) > 0){
$buffer = $ENV{'QUERY_STRING'};
@pairs = split(/&/, $buffer);
foreach $pair (@pairs){
($name, $value) = split(/=/, $pair);
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$$name = $value;
$qstring .= "$name=$value&";
}
}
$psid =~ s/[^a-zA-Z0-9]//g;
$post_data_file = "tmp/" . $psid . "_postdata";
$monitor_file = "tmp/" . $psid . "_flength";
$qstring_file = "tmp/" . $psid . "_qstring";
$len = $ENV{'CONTENT_LENGTH'};
$bRead=0;
$|=1;
# Check for max upload size, set to whatever you want
if($len > 32000000)
{
close (STDIN);
print "Content-type: text/html\n\n";
print "<br>The maximum upload size has been exceeded<br>\n";
exit;
}
# Send content-length to monitor file
if (-e "$monitor_file") {
unlink("$monitor_file");
}
open (MF,">", "$monitor_file") or die "can't open monitor file";
print MF $len;
close (MF);
sleep(1);
# read and store the raw post data on a temporary file so that we can
# pass it though to a CGI instance later on.
if (-e "$post_data_file") {
unlink("$post_data_file");
}
open(TMP,">","$post_data_file") or &bye_bye ("can't open temp file");
my $i=0;
$ofh = select(TMP); $| = 1; select ($ofh);
while (read (STDIN ,$LINE, 4096) && $bRead < $len )
{
$bRead += length $LINE;
$i++;
print TMP $LINE;
}
close (TMP);
#
# We don't want to decode the post data ourselves. That's like
# reinventing the wheel. If we handle the post data with the perl
# CGI module that means the PHP script does not get access to the
# files, but there is a way around this.
#
# We can ask the CGI module to save the files, then we can pass
# these filenames to the PHP script. In other words instead of
# giving the raw post data (which contains the 'bodies' of the
# files), we just send a list of file names.
#
open(STDIN,"$post_data_file") or die "can't open temp file";
my $cg = new CGI();
my %vars = $cg->Vars;
my $j = 0;
while(($key,$value) = each %vars)
{
$file_upload = $cg->param($key);
if(defined $value && $value ne '')
{
my $fh = $cg->upload($key);
if(defined $fh)
{
$tmp_filename = "tmp/$psid"."_actualdata"."$j";
open(TMP,">","$tmp_filename") or &bye_bye ("can't open temp file");
while(<$fh>) {
print TMP $_;
}
close(TMP);
$fsize =(-s $fh);
$fh =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$tmp_filename =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$qstring .= "file[name][$j]=$fh&file[size][$j]=$fsize&";
$qstring .= "file[tmp_name][$j]=$tmp_filename&";
$qstring .= "file[field][$j]=$key&";
$j++;
}
else
{
$value =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$qstring .= "$key=$value&" ;
}
}
}
# Write query string to file.
if (-e "$qstring_file") {
unlink("$qstring_file");
}
open (QSTR,">", "$qstring_file") or die "can't open output file";
print QSTR $qstring;
close (QSTR);
# Tidy up after ourselves.
unlink("$monitor_file");
unlink("$post_data_file");
# OK lets get back to album upload.
my $url= $redirect . "?psid=$psid";
print "Location: $url\n\n";
Its also tied into a php script, but this is what the perl side looks like... |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
|
ozzy214 -
Joined: 31 Mar 2006 Posts: 66
|
Posted: Mon Apr 03, 2006 1:45 pm Post subject: |
|
|
I tried increasing timeout to no avail. Got it up to 300 secs. As far as the size Im only uploading pics bout 2 mb. That aint much..... |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue Apr 04, 2006 8:13 pm Post subject: |
|
|
ozzy214 wrote: | I tried increasing timeout to no avail. Got it up to 300 secs. As far as the size Im only uploading pics bout 2 mb. That aint much..... |
Could you try with files around which size is around 100 KB? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Kavkazzz -
Joined: 16 May 2009 Posts: 17 Location: USA
|
Posted: Thu Aug 20, 2009 1:22 pm Post subject: Upload script failure |
|
|
Hi,
I have been using bformmail.pl in my web form for getting feedback, however I need to be able to get my users to upload attachments. Does bformmail.pl allow this as it isnt working ?
If not, is there another script I can use ?
Thanks in advance
-SPAM LINK REMOVED- |
|
Back to top |
|
|
Axis -
Joined: 29 Sep 2003 Posts: 336
|
Posted: Thu Aug 20, 2009 5:14 pm Post subject: |
|
|
Hello ozzy214--
I have a file upload script installed that works well. (On my site-- http://sixa.no-ip.info/upload.html )
You can download free (though they stick you with a 4 times a year newsletter) here:
http://www.perlservices.net/en/download/index.shtml --psupload
Hello Kavkazzz--
The above would allow you to get attachments alone but not with bformmail. I used bformmail for quite awhile but the recipients are always shown in the code so it is a spam collector. I would really suggest using dB Masters FormM@iler which is a simple two page php script. It hides recipients address and has a "sorta-CAPTCHA" to stop automatic submissions and says it supports attachments, though I don't use the attachment option on any of my sites. It is free if to use if (author quote) "FormM@iler is free to use provided I get credits in links on the form pages that use the script."
You can download this script here:
http://www.dbmasters.net/index.php?id=4
Regards,
Axis
I get zero spam with this script |
|
Back to top |
|
|
martinscott -
Joined: 22 Sep 2009 Posts: 1
|
Posted: Tue Sep 22, 2009 8:18 am Post subject: hi |
|
|
#!/usr/bin/perl
# Author: Bodo Eggert <7eggert@gmx.de>
# Status: pre-alpha
# License: GPL
# ObExcuse: This is my first perl script
#
# To use the script, make a subdirectory and save (or symlink)
# it there. This will be the script data directory.
# Adjust the path to your napshare temporary directory,
# any file not blacklisted and existing in that directory will be
# downloaded.
#
# While used as a filter, the filenames are normalized, matched
# against some filters and, depending on the result, written to
# 1.txt (new), 2.txt or 3.txt (different blocklists) as long as
# they are neither in f_getlist or f_blocklist.
#
# to download, move a line from 1.txt to f_getlist.
# to never display a line again, move it to f_blocklist.
# (if the filter is still active, rename the .txt-file first).
#
($cwd=$0)=~s/\/[^\/]*$//;
chdir $cwd;
#begin program variables
$GETLIST="f_getlist";
$BLOCKLIST="f_blocklist";
$NAPDIR="/d/napshare/"; #don't omit the slash!
#end program variables
#begin system variables
$FGREP="/usr/bin/fgrep";
#end system variables
$blocklist_f = "remix|.(wma|asf)\$|\\bentire album\\b";
$block_f="^t - [0-9]{7}|\^read ?me";
$blocklist_a = "\\b(Backstreet Boys|Janet Jackson|Missy Elliott)\\b";
$genres="\\&|[6-9]0s( music)?|alternative|copy (\([0-9]+\) )?of|new wave|oldies
$mode=' ';
$instring = $ARGV[0];
if(($instring=~s/^-(.)$/$1/)==1){
$mode=$instring;
$instring = $ARGV[1];
}
($ofilename, $size, $speed, $status, $tag) = split(/\//,$instring,5);
check: while(1) {
if($ofilename =~ /$block_f/i) {
$status=3;
last check;
}
($filename=$ofilename) =~ s/_|%20|\~/ /g;
$filename =~ s/\'| $//g;
$filename =~ s/-/ - /g;
$filename =~ s/ +/ /g;
$filename =~ s/(- )+/- /g;
do { $filename =~ s/^ -? ?//g;
} until(($filename =~ s/^($genres|\(($genres)\)|\[$genres\]|\{$genres\}
$filename =~ s/^ -? ?//g;
if(($filename =~ s/^\(([A-Za-z0-9, ]*)\)/$1 - /)
|| ($filename =~ s/^\(([A-Za-z0-9, ]*)\)/$1 - /)){
$filename =~ s/ +/ /g;
$filename =~ s/(- )+/- /g;
$filename =~ s/^ -? ?//g;
}
if(!system $FGREP, '-qsxi', '--', $filename, $GETLIST) {
$status=0;
} elsif(!system $FGREP, '-qsxi', '--', $filename, $BLOCKLIST){
$status=18;
} else {
$status=1;
##################################
if ($filename =~ /\.mp3$/i) {
($f=$filename) =~ s/(\.mp3)*$//i;
if ($f=~ /$blocklist_f/i) {
$status=2;
last check;
} elsif(-e $NAPDIR.$filename) {
$status=0;
last check;
}
@test = split(/ - /, $f, -1);
for($i=0;$i<@test;$i++){
if($test[$i] eq ""){splice(@test,$i,1);}
}
if(@test==1) {
@test = split(/[\(\)]/, $f, -1);
for($i=0;$i<@test;$i++){
if($test[$i] eq ""){splice(@test,$i,1);}
} }
if ($test[0] =~ /$blocklist_a/i) {
$status=2;
last check;
}
print @test.'#' .join(':', @test) . "\n";
# $status=0;
last check;
##################################
}
last check;
}
last check;
}
if($status == 0) { exit 0;}
if($status<16){
$LogFile = $status.".txt";
((-e $LogFile)? open(LOG,">>$LogFile"):open(LOG,">$LogFile"))
|| die("Can't open $LogFile: $!\n");
print LOG $filename."\n";
} else { print $status-16 .$filename."\n"; }
exit $status!=0; |
|
Back to top |
|
|
KipFrabrisp -
Joined: 31 Dec 2009 Posts: 1 Location: Guam
|
Posted: Sat Jan 02, 2010 12:19 am Post subject: Upload script failure |
|
|
Do you understand what youre doing?
mod_rewrite Rewrite engine has nothing to do with changing php settings.
in .htaccess
Code:php_value upload_max_filesize 40Mphp_value post_max_size 10Mphp_flag is for on / off setting.
for other setting, use php_value instead. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|