File upload hook - how to integrate existing file manipulation code into Drupal I want to create a waveform image for every mp3 file I upload in a Drupal 7 website (as admin), and store it as a png for display in the frontend.
I can use this script in order to do that.

I want to know what is the Drupal way of integrating that script, specifically:


I guess that functionality will go into a module; where should I hook? file upload (there will be more than one file types to upload, and I would just want to work on the mp3)?
how should I save the resulting waveform picture (where in the filesystem and how would I attach it as a field to my custom node type)?


As I'm new to Drupal (but experienced with PHP), I would appreciate a detailed response, but if you know of a module that already does that - I couldn't find it - that would be the shortest answer possible. :) 

Thank you!
Create a content type with a file field to upload the mp3 file.
Create a custom module and implement hook_node_presave. There you can do whatever you want with your node before it gets saved.
For the file handling have a look at File interface.