I came to see that form file input field value cannot be set with javascript for security reasons.
I just want to copy a FILE input to another form and post it, I searched for a work around and could not find anything, is it possible?
UPDATE: my code:
function prepareUpload( filevalue ){
document.getElementById('logo').value =filevalue;
var mform = document.getElementById('sleeker');
ajaxUpload( mform,'<?php echo base_url(); ?>'); // a methods to upload...
}
<input class=input-file-upload type=file size=20 name=logodummy id=logodummy onchange=prepareUpload( this.value ); />
<form action= method=post name=sleeker id=sleeker enctype=multipart/form-data onbeforesubmit=return false;>
<p><input type=hidden name=logo id=logo /></p>
</form>
Anything other thatn file input are working fine, and I could receive with $_POST, but $_FILES doesn't have values. And this code alone working fine too. I think this coe is enough?