Jump to content

[PHP] Base Multiple File Upload Script

- - - - -

  • Please log in to reply
2 replies to this topic

#1
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
This is an extremely basic multiple file upload script, great to use as a base for more complex upload scripts. User can define the number of files to upload, and upload them. It does NOT check for filetype, filesize, max upload limit or other stuff like that. That isn't hard to implement though :)

Scroll down to the next post to see how to implement some extra security with the use of an .htaccess file

Remember! >chmod 0777 upload/

Enjoy!

Edited by DEViANT, 16 October 2010 - 12:22 AM.

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
This is a nice script in that it is simple and AJAX, but an easy way to disallow files to be run (just uploaded) you can add this to .htaccess in your uploads/ folder:

RemoveType application/x-httpd-php .php .phtml .php3 .php4 .php5 .html
RemoveType text/html .html .htm .xhtml

RemoveHandler application/x-httpd-php .php .phtml .php3 .php4 .php5 .html
RemoveHandler text/html .html .htm .xhtml
PHP and HTML files will be served like a .txt file rather than rendered HTML or run PHP.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
Cool, thanks for the contribution :) I'll reference it in my first post

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users