Page 1 of 1

Trying to install an attachment script for my site...

Posted: Mon Feb 20, 2006 11:29 am
by LG-2
Hi I hope someone could give me a hand by pointing me to the right direction with something I have planned.

I am working on my site http://www.zumbalo.com and is like a Digg.com site but I want to instead of making it news I wan't to make it a media site...

The problem is. I don't know how to make a simple upload script that will work as an attachment script for video, image, and documents upload so they users can enjoy media. :(

What I need to know:

How can I make the upload script with...
  • Restricted file extensions. I only want avi, wmv, mpeg, mpg, jpg, png, gif, bmp, pdf, doc.
    Make it able to detech which file was uploaded and output the right player for it. (Img, the img src, and videos de embed src)
    Make it so that I can delete, edit the files in the admin.
    Work with MySQL.
I hope I aint asking too much, I just need some directions on how I can educate myself to do this. I am a complete newbie.

Posted: Mon Feb 20, 2006 11:50 am
by feyd
Each of the file formats listed has signatures in their binary data that will tell you if it's likely the actual format. Assuming the extension is truthful will bite you in the ass.

I've posted previously on detecting the actual file format of an upload:
Useful Posts wrote:Some helpful information determining a file's actual type: Upload Script

Posted: Mon Feb 20, 2006 12:38 pm
by LG-2
Nice, I get what you mean by this. I seen some programs like 4images that provide the file format, when I figure it out I will post it here.