O
Okyo
Guest
Hiho, ich beschäftige mich gerade damit, wie man Bilder uploaden kann und bin bei meinen Recherchen auf diese "IFrame-Methode" gestoßen. Das ganze läuft auf die AJAX-Technik hinaus, wobei die Iframe-Methode zum Einsatz kommt, da man mit AJAX keine Bilder uploaden kann (ich denke ihr kennt euch da schon aus). Meine Frage ist nun, ob mir das mit dieser IFRAME-Methode mal jemand mit einfachen Worten erklären kann. Ich verstehe den Ansatz nicht!
Ich habe folgenden Code aus einem Buch kopiert:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 6_1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="xmlhttp.js"></script>
<script type="text/javascript" src="functions.js"></script>
</head>
<body>
<div id="showimg"></div>
<form id="uploadform" action="process_upload.php" method="post"
enctype="multipart/form-data" target="uploadframe"
onsubmit="uploadimg(this); return false">
Upload a File:<br />
<input type="file" id="myfile" name="myfile" />
<input type="submit" value="Submit" />
<iframe id="uploadframe" name="uploadframe" src="process_upload.php"
class="noshow"></iframe>
</form>
</body>
</html>
Anschließend wird dann noch mit AJAX das Bild abgefragt, wobei AJAX jetzt mich mal gar nicht so interessiert, es geht nur um den "Asynchronen Upload".
Wozu brauche ich das IFrame? Wie ist hier die Vorgehensweise...
Danke im vorraus!
Ich habe folgenden Code aus einem Buch kopiert:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 6_1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="xmlhttp.js"></script>
<script type="text/javascript" src="functions.js"></script>
</head>
<body>
<div id="showimg"></div>
<form id="uploadform" action="process_upload.php" method="post"
enctype="multipart/form-data" target="uploadframe"
onsubmit="uploadimg(this); return false">
Upload a File:<br />
<input type="file" id="myfile" name="myfile" />
<input type="submit" value="Submit" />
<iframe id="uploadframe" name="uploadframe" src="process_upload.php"
class="noshow"></iframe>
</form>
</body>
</html>
Anschließend wird dann noch mit AJAX das Bild abgefragt, wobei AJAX jetzt mich mal gar nicht so interessiert, es geht nur um den "Asynchronen Upload".
Wozu brauche ich das IFrame? Wie ist hier die Vorgehensweise...
Danke im vorraus!