
It is all very well to upload and share your photos with the world on Facebook, but sometimes it is also pretty handy to be able to pull them down again for backup purposes. Enter a brilliant little application that makes it a breeze to download full photo albums from either your own profile, associated groups or liked pages. Pick&Zip is the fantastically clean and well presented online tool which through it’s flash driven interface allows you to select your own albums or photos where you have been tagged and then download the selected set either as a zip file or as a pdf – directly from your browser! No messy installs to work with whatsoever! :) To work, it requires that you allow the app to link with your profile, and if you are okay with that, go ahead and log in using the Facebook oauth login system. From there it is a matter of browsing the albums you want to view using the tree on the left, selecting the photos to download and then confirming the download format – as simple as that! One thing to note though is that thanks to Facebook’s new privacy controls, the application only allows you to download files uploaded by your friends, which makes sense but is a little frustrating if you wanted to say download other people’s albums for more devious purposes (not that you ever would of course!) :P It is well written, features a great interface and is packaged [...]
Borrowing from the always brilliant Mr. David Walsh, here is a great little function to create a zip file archive of a given set of files, ready for download from your site. First, the zip file create function which will be doing all the heavy lifting: function create_zip($files = array(), $destination = ”, $overwrite = false) { //if the zip file already exists and overwrite is false, return false if (file_exists($destination) && !$overwrite) { return false; } //vars $valid_files = array(); //if files were passed in… if (is_array($files)) { //cycle through each file foreach ($files as $file) { //make sure the file exists if (file_exists($file)) { $valid_files[] = $file; } } } //if we have good files… if (count($valid_files)) { //create the archive $zip = new ZipArchive(); if ($zip->open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) { return false; } //add the files foreach ($valid_files as $file) { $zip->addFile($file, basename($file)); } //debug //echo ‘The zip archive contains ‘,$zip->numFiles,’ files with a status of ‘,$zip->status; //close the zip — done! $zip->close(); //check to make sure the file exists return file_exists($destination); } else { return false; } } Right, now that we have the function, let us set about putting it to use. First, we’ll need an array of fully qualified files to use, for example: $filestozip = array( ‘/var/www/uploads/file1.jpg’, ‘/var/www/uploads/file2.jpg’, ‘/var/www/example3.html’ ); Now we simple run the function, providing it with our array of files to be included, the proposed name of the archive we want to generate, as well as [...]
You might have come across .cbr or .cbz files during one of your many adventures of trawling through the Internet. What are these mysterious files that Windows doesn’t seem to be able to identify? Simply put, they are what are know as Comic Book Archive files, something that has become a sort of a de facto standard when it comes to putting out scanned comic books onto the web. Basically all a .cbr or .cbz file is, is a stardard ZIP or RAR archive file (the ‘z’ or ‘r’ at the back gives away which one) containing a number of image files. These file types are automatically opened by so called comic or manga viewers, and are thus a very useful way for keeping comic books consisting of multiple scanned images in a rather organised fashion. The Wikipedia entry on the matter lists some useful comic book readers in case you are interested in delving deeper into this little world. And now you know. Related Link: http://en.wikipedia.org/wiki/Comic_Book_Archive_file

Just a quick one-liner to remind me how to ultra compress a file using 7za instead of the bog standard gzip which I always seem to automatically turn to because its the only one I can remember out of my head!

File archiving is a particularly simple affair and there are quite a few different archive algorithms to pick and choose from. GZip (.gz) has for long been associated with Linux as one of its main archiving algorithms and so today’s quick command line tip highlights how to quickly create a zipped file on your system.

The other day I needed to automate the unzipping and processing of files contained within a zip archive. Using the existing PHP Zip library and some help off the web, this is what I was left with:
Craig Lotter is an established web developer and application programmer, with strong creative urges (which keep bursting out at the most inopportune moments) and a seemingly insatiable need to love all things animated. Living in the beautiful coastal town of Gordon's Bay in South Africa, he games, develops, takes in animated fare, trains under whichever martial arts dojo is closest at the time, and for the most part, simply enjoys life with his amazing wife and daughter.
Oh, and he draws ever now and then too.
This is a collection of things that he has managed to find the time to scribble down since 2007.
Looking for Something?
Jump to Category: