Thread: uploadfile()
View Single Post
  #15  
Old 07-24-2009, 11:27 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by cbk1994 View Post
Can you explain how you would limit the files they can upload? I'm not too keen on players uploading .exe files, for example.
PHP Code:
temp.allowed = {"graal","nw","gani","png","gif","mng"}; //still don't get mng :\
temp.fileName.tokenize(".");
if (!(
t[fileName.size()-1in allowed)) {
  
//stuff code stuff

Pretty sure that could be used, just replace fileName with whatever you're using to get the file name. Not 100% on that since I don't know if it's possible to check the name.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 07-24-2009 at 11:39 PM..
Reply With Quote