CUploadedFile: how to make md5 from file content?


I’m uploading an file using CUploadedFile as explained here:

Before saving the file, i like to generate an md5-sum from the image in oder to create unique file names.

So if i upload the same file twice, it’s saved under the same name.

Is there a way to acces the binary file code from the uploaded file??

Thank you, rall0r.

//Edit: as i saw right now. one way could be to use the attribute getTempName() to generate an md5 sum from the temp file using md5_file($myfile->getTempName())…