Submitted by wjones on Wed, 03/02/2011 - 1:49pm
I want to rewrite the file name when a user uploads a file. How on earth do you do that?
There appears to be very little documentation on this, so I present to you my solution, and an explanation of how I figured this out. Hopefully this will help a stranded Drupaler out there.
The Code Snippet
The following code will rewrite an uploaded file's filename from to 1234567890_<timestamp>, where "1234567890" is the timestamp.
Insert this into a custom module: