Bushman
Erfahrenes Mitglied
Ich hab da ne Frage, wie kann ich die Dateiendung herausfinden?? Ich bräuchte diese Funktion für nen Upload Script!
Kann vielleicht eienr mal ne Funktion posten??
Kann vielleicht eienr mal ne Funktion posten??
PHP:
<?php
if ( $sub == "" )
{
?>
<form enctype="multipart/form-data" action="?sub=upload" method="POST">
<input type="file" name="file">
<input type="hidden" name="MAX_FILE_SIZE" VALUE="10000">
<input type="hidden" name="cID" value="17">
<br>
<input type="submit" value="Upload">
</form>
<?php
}
if ( $sub == "upload" )
{
if ($file_name)
{
$filepath = "pics/";
$type = ".jpg";
$ziellocation = $filepath.$cID.$type;
copy($file,$ziellocation);
unlink($file);
}
else
{
echo "Keine Datei eingefügt";
}
}
?>