upload form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
volito
Forum Newbie
Posts: 9
Joined: Wed Dec 07, 2005 9:48 pm

upload form

Post by volito »

$upload->set_acceptable_types('image'); // comma separated string, or array



How do I get this to also except plain text file. Using an upload form for images and would like to let users upload small text file.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

well we would have to see this class that you are dealing with.

beware, there is no real way of telling if it is a txt file or not for sure. the only way that comes to mind is strpos for .txt but I can still have a file bad_virus.exe.txt and it would still run as a exe and thus be a very big security problem.
volito
Forum Newbie
Posts: 9
Joined: Wed Dec 07, 2005 9:48 pm

Post by volito »

OK sounds logical .

What I am trying to do is actually add a comments section to my multi upload form.
To be honest I am new to PHP and get my scripts from online sources "free or purchased"


I use this form for only select few to upload pics and highlights of a game.

Any ideas will be greatly appreciated.

Thanks !
Post Reply