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!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Im trying a content management sys using PHP. Im uploading files to a database based around the following fields fileID, userID, filename, filesize, filetype. I seem to be having problems downloading the files in internet explorer they are being printed out as gibberish on the page, rather than using the correct appliaction.
Internet eplorer seems to ignore header("Content-type: $type");. Is there a way to store the file extension when uploading. And then use that file extension opening a file
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Have looked into database at how the information is being stored and the fileType field has the correct information associated with it.
i.e. If i upload a word document the fileType = application/msword
You need to remove those error suppression operators and do proper error-checking. Wrapping those calls inside if statements may shed some light on this problem, are you sure the correct data is being pulled?
What version of internet explorer are you using?
I don't know what this does but I saw it in the manual, perhaps you should try it:
Always make sure you use mysql_real_escape_string() on $_GET/$_POST/$_REQUEST values before sticking them into queries -- it wouldn't be hard for someone delete everything in your database the way it is right now.
First, I would try dumping the Content-length header, and seeing if it works. Quotes around $name in the Content-Disposition header wouldn't hurt. Is the file extension already appended to $name?