Archive

Posts Tagged ‘files’

How to calculate the space used by files in Linux?

February 19th, 2010 fvicente No comments

Suppose that you want to calculate the space used by all the png files in current directory and all its subdirectories. From a terminal type:

find . -name '*.png' -exec du -ab {} \; | awk '{total+=$0}END{print total}'

Image source

File Upload Progress with mod_python

March 28th, 2009 fvicente 1 comment
Upload Progress with mod_python

Upload Progress with mod_python

Now that Gmail has added a progress bar for attachment uploads, everybody wants to do the same including myself :)
So, with the same method that everybody uses consisting in an upload form with a hidden <iframe> as target, and then a periodic Ajax request to update the progress, I made a simple implementation using mod_python on the server side… This is a veeery simple example, like everything that you do with Python.
Additionally I’ve added an upload size limit control based in examples that can be found in the mod_python forum site. Use the source Luke!

See LIVE DEMO!

Read more…