I'm writing a multi-upload php script and I need to add the string "USERID_"to each uploaded filename where USERID is the actual userid of my application: (e.g. WA9SRV_uploadedfiilename.adi).
Is there an easy way to do this?
It looks like the Javascript below might do the trick, but I can't figure out how to use it or where to place it in my PHP application. My PHP code pretty much follows the Multi Upload example.
<script type="text/javascript">
kul.registerEvent("OnBeforeUpload",function(sender,arg){
//Attach the folder information before the file is uploaded.
//This info will able to achieve at server-side by $_POST["folder"]
var item = kul.getItem(arg.ItemId);
item.attachData("folder","temp/user1");
return true;
});
</script>