note 44487 deleted from function.copy by vincent
| From: | vincent@php.net | Date: | Sat, 07 Aug 2004 18:34:08 +0000 |
| Subject: | note 44487 deleted from function.copy by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74150@lists.php.net to get a copy of this message | ||
Note Submitter: selman17@yahoo.com
----
This is code select jpeg or everyone else and upload it.
<?
if(isset($_FILES["resim"])){
$uid ="asd";
$a = "resim/".$uid.".jpg";
copy ($_FILES["resim"]["tmp_name"], $a)or die("resim kopyalanamadi");
echo"resim kopyalandi<br>
<img src='".$a."'>
";
}
?>
<html>
<head>
<script type="text/javascript" language="JavaScript">
<? echo "
function check() {
var ext = document.f.resim.value;
ext = ext.substring(ext.length-3,ext.length);
ext = ext.toLowerCase();
if(ext != 'jpg' || ext != 'jpg') {
alert('Dosya Uzantiniz : .'+ext+
' Lütfen jpg yada jpeg formatlarini kullanin!');
return false; }
else
return true; }
";
?>
</script>
</head>
<body>
<form method="post" name="f" enctype="multipart/form-data"
onsubmit="return check();" action="?">
<p>
Please select a JPEG (.jpg) file to be sent:
<br>
<input type="hidden" name="ok" value="ok">
<input type="file" name="resim" size="40"
accept="image/jpeg">
<input type="submit" value="Send">
</form>
</body>
</html>