I have been searching for two days to find a solution which will let me upload employee image and rename it, I couldn't find any. Turns out it's pretty simple, I have to just pass the filename as query string and do a little modification in uploadify.php file.
- Passing the filename as part of the query string - followed by '?' mark include the filename with the paramater 'script'
'script' : 'uploadify/uploadify.php?name=imagename'
//don't worry about the extension - Modify the following line
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
with this
if(isset($_GET['name'])){ $targetFile = str_replace('//','/',$targetPath) . $_GET['name']. substr($_FILES['Filedata']['name'],-4); } else{ $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; }