note 44488 added to function.copy
| From: | selman17 at yahoo dot com | Date: | Sat, 07 Aug 2004 18:06:22 +0000 |
| Subject: | note 44488 added to function.copy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74149@lists.php.net to get a copy of this message | ||
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>
----
Manual Page -- http://www.php.net/manual/en/function.copy.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44488
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44488&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44488&report=yes
Search -- http://master.php.net/manage/user-notes.php