Uploadify - Passing renamed file back to form
Hi,
jQuery noob here! I'm trying out uploadify to upload images & files. Got it all working fine and got it so that it inserts the filename as a hidden form element so I can grab the filename on post and insert into the database -
- <script type="text/javascript">
- $(document).ready(function() {
- $('#file_upload').uploadify({
- 'buttonImg' : 'images/browseBtn.png',
- 'height' : 21,
- 'width' : 84,
- 'wmode' : 'transparent',
- 'scriptAccess' : 'sameDomain',
- 'uploader' : 'uploadify/uploadify.swf',
- 'script' : 'uploadify/uploadify.php',
- 'cancelImg' : 'uploadify/cancel.png',
- 'folder' : 'images/blog',
- 'expressInstall' : 'Scripts/expressInstall.swf',
- 'auto' : false,
- onComplete : function(event, queueID, fileObj, response, data)
- {
- $('#filesUploaded').append('<img src='+fileObj.filePath+'>'+'<br />'+fileObj.name+'<input type="hidden" name="uploaded_image" id="uploaded_image" value="images/blog/'+fileObj.name+'" />');
- $("#firstUpload").remove();
- }
- });
- });
- </script>
But I want to rename the file in uploadify.php and pass the renamed value back to the form, so far, I can only get it sending back the original file name.
Any ideas?
Thanks