Firefox 3.6+ Drag and Drop Image File Manager ================================================ Author: Craig Morrison When: 2010/03/01 Where: http://www.sillywindows.com/imgfm.tar.gz Support Issues: https://secure.sillywindows.com/ Contact: support@sillywindows.com ================================================ Requirements: * Firefox 3.6 or better (of course) * A web server (doh!) * A MySQL server (SQL dump is v5+) * PHP 4+ Intallation: * Unpack the tarball where you want it. * Import imgfm.sql into a database. * Edit inc/includes.php: * To match your database details. * Set your image path. You will need fold, spindle and mutilate rights to this directory. * Set the largest image size you will accept. * Set the maximmum disk space allowed for image files. * Change the admin username and password with your favorite MySQL database tools, it defaults to User: admin Password: letmein Navigate to the URL where you unwrapped the tarball. Usage: Clicking a file toggles its selection state. Hover over the button images for information on what each does. The following image options are available: * Upload (of course!) * Download * Remove * Rename * Resize * Preview Most of the operations should be self-explanatory. To preview images right click on them and they will appear in a lightbox. You can have multiple asynchronous upload streams running at the same time. Just drag additional file sets over to the drop target. There are some drop targets that perform actions: * Remove * Download Dropping files on these image button targets performs the requested action. Currently this web app only operates on a single directory. I may at some time in the future extend it to include directory support. Don't hold your breath waiting for it though. ;-) This was an exercise for me to learn the principles behind creating a full fledged web application. It fully exploits the capabilities that FF3.6+ provides for creating a rich user experience. Some of the features that were taken advantage of are: * Drag and Drop * From the desktop * Element to element * Upload progress events * Rounded corners * Box shadows * Canvas based image resizing Note: when you have image resizing turned on for uploads, the resizing is done on the *client* side before the file is uploaded to the server. Canvases are uber cool for saving bandwidth. If you can, I would advise having this turned on. If you resize an image already on the server there will be a round trip done for the image. I think its turned out fairly well. I hope you enjoy it as much as I did writing it. Parting Shot: If the filename for a resized image doesn't change, you will most likely no doubt note that the lightbox will show the wrong image if Firefox has seen the image before. This is not a bug in the application, this is being caused by the Firefox cache. You'll have to force a refresh of the page. I haven't found an elegant solution to this problem yet as it isn't a bug in the web app. To stop the updates of the width and height edit boxes when you mouse over a filename, hold the shift key down. This comes in handy if you have an image already uploaded that you want to use the dimensions for when resizing images.