how can i upload files other than images and retrieve them?
| SitePoint Sponsor |


how can i upload files other than images and retrieve them?
Well, how would you do it with images?
It's exactly the same as with images, you just need different verification techniques.
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona


m being able to upload images but i don what to do with other files
what do u maen by "different verification techniques."
what shud be the changes
Well, it all depends on the code you're using to upload your images. (i.e. can you post it here?).
If it's image-specific, you'll have things such as checking the MIME type or extention, maybe further verification to make sure it's an image.
For other files, you'll want verification about those types, or maybe no verification at all.
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona





You should validate the file's MIME type instead of taking the browser's word for it. These PHP functions and extensions are made for that purpose:
mime_content_type
fileinfo
Bookmarks