Im working on website, Im new to PHP, right now when a image is uploaded its placed in "uploads/" and renamed so its 8 random numbers in front of the file name. Now what I want do do is all the spaces in the name gets renamed to a _ and uppercase gets renamed to lower. Also how do I limit file types and size? The only thing i could offer in return is maby ad space on the site and/or loads of web space =P Post here or add my msn: Also what a nice forum i just found
use that way: $fname : the original filename, prefixed or not with that 8 numbers $fname=strtolower($fname); $fname=str_replace(" ","_",$fname); Code (markup): and you'll have what you need. About file type and size... you can check that in the $_FILE['filename'] Enjoy You can check there the uploaded file size and also the mime type (file type). And also checking extension for the original filename will help.
Use my ready script or: * rename files to 8 unique random characters (taking out the old name). * place that id in the database along with the filesize,orginal name (for download) and hits This would keep you from being hacked. Peace,
How do i get the width and high and make them to varibales....? When echoing out the link for html, how do i siplay the " as normal... <img src="http://www.mysite.com/uploads/image.jpg" width="500" height="500" /> So how would i do this if the imagename is: $new_file_name hight: $hight and width: $width