File: upload.htm

package info (click to toggle)
libembperl-perl 2.5.0-17
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 7,632 kB
  • sloc: ansic: 21,387; perl: 14,497; javascript: 4,280; cpp: 467; xml: 49; makefile: 35; sh: 24
file content (42 lines) | stat: -rw-r--r-- 861 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

<html>
<head>
<title>Embperl Examples - File-Upload</title>
</head>
<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">
    </FORM>

[$else$]

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

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

<FORM METHOD="GET">
  <INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Upload new file">
</FORM>


[$endif$]

<p><hr>

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

</body>
</html>