hlstriker Posted August 19, 2006 Share Posted August 19, 2006 Hi, is there a way I can open up a zip file and check for file extensions before it uploads to my server?For example: I click browse, find my file, push ok. Now I push my Submit button and it runs my php code to upload to file to my database.I just need to have it check to see if it is a .zip file, and then open the zip and see if only one type of file is inside it (.txt file for exaple), and if anything other than a .txt is inside it will give an error and not upload.If anyone can help me out that would be great. Thanks! Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 19, 2006 Share Posted August 19, 2006 In order for php to do anything with the file it must be uploaded. PHP is a server side technology.In order to do what you are wanting, you can use one of the libraries located at phpclasses.org:http://www.phpclasses.org/browse/class/42.htmlto unzip the file to a location, then check each file that was unzipped using the dir functions (http://www.php.net/dir) Quote Link to comment Share on other sites More sharing options...
hlstriker Posted August 19, 2006 Author Share Posted August 19, 2006 Thanks hitman6003, now does anyone know if there is a virus scan library out there. I searched at phpclasses.org but didn't find anything. I need to scan the files being uploaded for viruses and malware. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.