Recently i added a file manager script to allow my members to host things on my site rather than linking to them from another site. This is my first ever time doing file uploading in PHP and i am having trouble with uploading certain file types. I have implemented the most common image types into it but i have no idea how i would be able to anything except images. I searched all over the web for file uploading examples but they only seem to demonstrate how to set a type as an image. The other types of files i'm allowing people to upload are:
I don't actually get it! PHP has no special way of handling images. It's global. If you can upload images, you can upload anything else.
can you elaborate more on what you want to do and what exactly is it that you are having problem with?
Also you could look at my upload script which handles any type configured: http://www.phpsimplicity.com/scripts.php?id=3
__________________ PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
well i currently have the types set at things like.. image/png and image/bmp so i just assumed that it would be something like file/zip to upload a zip. So what you are saying is that i could just put .png and that would work?
But one thing, do not rely on the value in $_FILES['x']['type']. This value is defined by the browser, and can be modified. Plus, some browsers (specially when IE is involved) send different types. Validate the files by extension, and images for example using getimagesize().
If you have the fileinfo library installed and working, then use this instead.
Yeh that's exactly what i meant. Sorry i didn't seem very clear. End users list on that threed is very helpful but now you are suggesting that i don't use $_FILES['x']['type']; i will have to tweak my script a bit. Anyway thanks to both of you for helping me get my head around that