Posts

Showing posts with the label file

(က) Polpetta, any folder is served spiced

The quick version is: have you ever thought about using node.js to make any folder as a web-server and in a PHPish way where .njs files are required and executed runtime as node modules ? Oh well, I did, and this is the result in Github: polpetta ... enjoy!

100% Client Side Image Resizing

... I know, I have said " Happy Holidays " already, but yesterday, after a (annoying) picture upload in Facebook , I had a an idea ... why on earth I should have a Java plugin to perform images resizes on Facebook? Why on earth if I don't have such plugin I have to wait the possibly extremely long upload, up to 10x slower for high quality images, stressing Facebook servers for such " simple " operation as an image resize/resample could be? The FileReader Interface In the W3C File API , I guess part of the HTML5 buzzword, we can find all we need to perform the operation we want totally on client side. The interface is called FileReader , and it provides functionalities to read chosen files from an input node with type file, and that's it: we can even disconnect from the network and keep resizing and saving images without problems . The Canvas Trick Still into HTML5 buzzword world, the canvas element and it's 2dContext.drawImage method is the key to perfo...

Safari 4 Multiple Upload With Progress Bar

Update - I slightly modified the demo page adding another bar, the one for the current file. I'll update the zip asap but all you need is a copy and paste of the JS in the index. Apparently multiple should be set as multiple, rather than true ... in any ... it works as long as it is an attribute. This one from Ajaxian has been one of the best news I could read about HTML5 specs and browsers evolution. I could not wait to download Safari 4 and test instantly this feature. I have always been interested in this possibility, both progress bar, plus multiple uploads and that's why I would like to add this post to this list: PHP upload progress , 22 September 2005 FileReference for JavaScript , 08 November 2005 Upload progress bar with PHP5, APC and jQuery , 09 October 2007 First Step: The Input Type File We can create a multiple input files in different ways: directly in the layout <input type="file" multiple="multiple" /> or via JavaScript:...

packed.it goes off line !

... or, to be honest, that's what it's gonna do in few days, but PHP version is out ! You can find every information about server side version of packed it directly in this page . I am not joking when I said that packed.it is probably the fastest optimized client files server you can find over the net, even with an uncompiled program language like PHP. The key is the JOT compiler, compile one time, serve all the time without paranoia, saving bandwidth for both server and client, avoiding the usage of gz handlers, avoiding runtime compression, avoiding whathever you want, and finally, having the possibility to serve js, css, or both with a single file. Discover by yourself how long server need to serve, for example, jQuery ... less than one millisecond without louds of requests ... please look at X-Served-In header, if you do not trust me :P What's new? You do not need to pass in packed.it site to compile your projects, you can just serve and compile them directly from yo...