phpretard Posted August 2, 2009 Share Posted August 2, 2009 The Files uploading but I cant seem to get the extention after renaming it. Any thoughts? <?php function findexts($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } define ("FILEREPOSITORY","./"); if (is_uploaded_file($_FILES['file']['tmp_name'])) { if ((($_FILES["file"]["type"] != "image/gif") || ($_FILES["file"]["type"] != "image/jpeg") || ($_FILES["file"]["type"] != "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { echo "<p>Wrong file format format.</p>"; } else { $name = $_POST['name']; $exts= $_FILES['type']; $result = move_uploaded_file($_FILES['file']['tmp_name'], FILEREPOSITORY."/$name.$exts"); if ($result == 1) echo "<p>File successfully uploaded.</p>"; else echo "<p>There was a problem uploading the file.</p>"; } #endIF } #endIF ?> <form action="<?php print $PHP_SELF?>" enctype="multipart/form-data" method="post"> Last Name:<br /> <input type="text" name="name" value="" /><br /> Class Notes:<br /> <input type="file" name="file" id="file" value="" /><br /> <p><input type="submit" name="submit" value="Submit Notes" /></p> </form> Thank you! Link to comment https://forums.phpfreaks.com/topic/168456-image-uplaod-help-please/ Share on other sites More sharing options...
gevans Posted August 2, 2009 Share Posted August 2, 2009 I see you have a function, but where are you trying to use it? Link to comment https://forums.phpfreaks.com/topic/168456-image-uplaod-help-please/#findComment-888606 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.