Jump to content

File Upload Problem.Kinda XD


scheols

Recommended Posts

Alright I want 2 make my script stop if they dont contain the file types i provide.

here are the file types:


$file_type = array("js","gif","jpg","txt","png","jpeg","bmp");

heres my code:

[code]
<?php
$name = $_FILES['userfile']['name'];
if(!(copy($_FILES['userfile']['tmp_name'], "images/" . $_FILES['userfile']['name']))) die("Cannot upload files.");
echo "Upload Complete!<br>";
echo "<a href='"."http://xizionz.vectoredhost.com/images/"."$name"."'>"."Here"."</a>";
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/14653-file-upload-problemkinda-xd/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.