seventheyejosh Posted July 2, 2009 Share Posted July 2, 2009 Hello all, i was wondering if there is an htaccess command that would allow me to allow all files that are like the following (with % being wildcard) : %_class.php to be uploaded via ftp and deny all others. Is that possible? basically i want to write a dir reader to include all files in the classes dir and auto make a new class() for each one just by parsing out the _class.php at the end. I have that part, but if somehow like ok.php or what.jpg etc ends up in the classes dir, it craps out. I could just do some checking in the php, but i figured i'd take the opportunity to learn some more about htaccess. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/164522-solved-allow-deny-files/ Share on other sites More sharing options...
rhodesa Posted July 2, 2009 Share Posted July 2, 2009 can you clarify some info on how files get in the directory? you say FTP, but .htaccess is for Apache (which is the webserver, not the FTP server) Quote Link to comment https://forums.phpfreaks.com/topic/164522-solved-allow-deny-files/#findComment-867777 Share on other sites More sharing options...
seventheyejosh Posted July 2, 2009 Author Share Posted July 2, 2009 I guess thats true. I use FireFTP to upload, but i guess that the .htaccess dir allow/deny is only when a user submits a file right? to deny hack.jpg.php etc etc... Quote Link to comment https://forums.phpfreaks.com/topic/164522-solved-allow-deny-files/#findComment-867813 Share on other sites More sharing options...
rhodesa Posted July 2, 2009 Share Posted July 2, 2009 kind of either way, i would just limit what is loaded via PHP. which is good too, cus if you want to temporarily disable a class, you can just rename it to *.bak and it won't get loaded by the app Quote Link to comment https://forums.phpfreaks.com/topic/164522-solved-allow-deny-files/#findComment-867835 Share on other sites More sharing options...
seventheyejosh Posted July 2, 2009 Author Share Posted July 2, 2009 K thanks much! ~solved Quote Link to comment https://forums.phpfreaks.com/topic/164522-solved-allow-deny-files/#findComment-867837 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.