Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2005
    Location
    Atlanta, GA
    Posts
    171
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Upload image file from IE

    I have a form with a file button. I have not used this in quite some time, but it worked before. It is not working now because the windows path is not passed to the CGI perl program. What am I missing?

    Here is the HTML
    <form action="uploadimage.cgi" method="post" ENCTYPE="multipart/form-data" name="upload">
    <input type="file" name="imagename" size="48" border="0">

    Here is the perl code
    Code:
    if ($imagename ne "") {
    $file1 = $imagename;
    $file1 =~ s/.*[\/\\](.*)/$1/; #parse file name from windows path#
    $upload_filehandle = $imagename;
    print "<br>$path/$file1";
    print "<br>$upload_filehandle<br>";
    open(OUT, ">$path/$file1") || die print "Fail to upload: $!"; 
    binmode OUT; 
    while(<$upload_filehandle>) {
    print OUT;
    }
    close(OUT);
    }
    Last edited by tdavis; 12-10-2010 at 07:50 PM.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    Atlanta, GA
    Posts
    171
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Crap. Nevermind. It was not what I thought. Looks like the path is dropped by IE8, but that is not the problem. The file is delivered just fine to my perl program. The problem was the path to the server. Thanks anyway!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •