I'm not sure why the file name is affecting the upload but Give this a try.
Hope it helps.
use CGI; $cgi=new CGI; $file=$cgi->param('file_field'); $newName=&FileUpload($file); sub FileUpload{ my $FileName=shift @_; my $tmpdir ="/your/path" my $bufferSize=4096; my $limit=10000000;#File Size Limit my ($debug, $FILE, $file, $size, $tmppath, $line, $buffer); $size = 0; if (length($FileName) != 0){ $| = 1; $FILE = $FileName; ($file = $FILE) =~ s/^.*?([^\\\/]+)$/$1/; $tmppath = "$tmpdir\\$file"; open (OUT, ">$tmppath") or print "Error opening $tmppa +th: $!<br>\n"; binmode OUT; while(($line = read ($FileName, $buffer, $bufferSize)) + && ($size < $limit)){ print OUT $buffer; $size += $line; if ($size > $limit){ $err_flag = 1; } } close OUT; $| = 0; $FileName = $file; } else{##Empty File $FileName = ""; } #Upload Error if ($err_flag == 1){ unlink ($tmppath); $FileName = ""; } $FileName; }
Tom

In reply to Re: YAF(ile)U(ploading)Q(uestion) by tcf22
in thread YAF(ile)U(ploading)Q(uestion) by skazat

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.