Question: Does anyone know of a good way to automatically run certain file types through a processing script on upload? I'm trying to accomplish automatically minifying CSS and Javascript when I upload them to the server, keeping a nice, human-readable version on the local side while keeping a minified one on the server. I'm currently using WinSCP on Windows, which is scriptable to some degree but might not be scriptable enough. I'd probably need some kind of cobbled-together solution, so don't be afraid to suggest something with duct tape in it; however, I do need to do the minification on my local computer and upload the squished file, since I use shared hosting and can't install junk on the server.

Thanks.

Answer: 
Since you're on shared hosting, I'd just suggest using the [YUICompressor](http://developer.yahoo.com/yui/compressor/), and running your css/js files through it prior to uploading them. Be sure not to lose your original files - it could be a pain making future changes.

You could also place a script on your server that would periodically re-write your css/js files, passing them througha minify-process, and manually invoke this script after doing an upload.
Realy cool solution whice make serving js and css automagically like a dream.

Check: <http://code.google.com/p/minify/>

Features

* Combines and minifies multiple CSS or JavaScript files into a single download
	+ Uses an enhanced port of Douglas Crockford's JSMin library and custom classes to minify CSS and HTML
	+ Caches server-side (files/apc/memcache) to avoid doing unnecessary work
	+ Responds with an HTTP 304 (Not Modified) response when the browser has an up-to-date cache copy
	+ Most modules are lazy-loaded as needed (304 responses use minimal code)
	+ Automatically rewrites relative URIs in combined CSS files to point to valid locations
	+ With caching enabled, Minify is capable of handling hundreds of requests per second on a moderately powerful server.
	+ Content-Encoding: gzip, based on request headers. Caching allows it so serve gzipped files faster than Apache's mod\_deflate option!
	+ Test cases for most components
	+ Easy integration of 3rd-party minifiers
	+ Separate utility classes for HTTP encoding and cache control `enter code here`