For the rar part: you'll have to write your own script for that and, it will be slow. Rar is a proprietary product from Rarlab and the only way to extract rar files through php is by using their unrar commandline program. This however is very slow way of doing things and it won't work with PHP safe mode enabled. I simply don't recommend you to use rar files, stick with the zips.