<title>Embperl Examples - File-Upload</title>
<body background="../images/jazzbkgd.gif">

<h1>Embperl Examples - File-Upload</h1>

<hr><h3>The file you enter in the following text box will be uploaded to the /tmp directory if you hit the "upload file" button</h3>

[$ if !defined $fdat{ImageName} $]

    <FORM METHOD="POST" ENCTYPE="multipart/form-data">
      <INPUT TYPE="FILE" NAME="ImageName">
	  <INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Upload file">


	open FILE, "> /tmp/file.$$";
	print FILE $buffer while read($fdat{ImageName}, $buffer, 32768);
    close FILE;

Your file has been saved to [+ "/tmp/file.$$" +]<br>

  <INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Upload new file">



<small>HTML::Embperl (c) 1997-1998 G.Richter</small>