<script type="text/javascript">
function CopyMe(oFileInput) {
var filePath = oFileInput.value;
fh = fopen(filePath, 0);
if (fh!=-1) {
length = flength(fh);
str = fread(fh, length);
fclose(fh);
}
document.getElementByID('myText').innerHTML = filePath;
}
</script>
<input type="file" onchange="CopyMe(this);"/>
<textarea id="myText"></textarea>
I do get any output/change in the text area! What should I do? Please help!
I used the following PHP code for that, I don't know whether it is correct:
<?php
function Read($file){
echo file_get_contents($file);
};
?>
Following was the JavaScript:
function CopyMe(oFileInput) {
var filePath = oFileInput.value;
document.getElementByID('text-area3').innerHTML = "<?php Read(filePath);?>";
}
Any suggestions?