Page 1 of 1

echo return TMP file name

Posted: Fri Mar 19, 2004 4:01 pm
by ol4pr0
Would be nice if somebody has the answers

Code: Select all

$ext = strrchr($file_name,'.');
if (($limit_ext == "yes") && (!in_array($ext,$extensions))) {
$endresult = "<font size="2">File is wrong type</font>";
}else{
@copy($file, "$absolute_path/$file_name") or $endresult = "<font size="2">Couldn't Copy File To Server</font>";
}
}
}
}
$uploaded = $file_name; // also tried $file ?>



//-java-

<script language="JavaScript">
file = ("<?php echo $file ?>");
alert("file uploaded " + file);
</script>

/*
THIS WILL ECHO file uploaded WINNTTEMPphp6.temp
*/
what am i missing ( it for the process it wont really mather if i get the real filename or just the tmp. the file is uploaded. but it would look nice to get the real name

Posted: Fri Mar 19, 2004 4:07 pm
by ol4pr0
Fix it ;-) and some other small bugs ;-)


thanks for looking

Posted: Fri Mar 19, 2004 4:08 pm
by penguinboy

Code: Select all

<?php

if(isset($file))
print 'file is set';

?>

Posted: Fri Mar 19, 2004 4:16 pm
by ol4pr0
that would do it 2 ;-) the uploaded call from php i did get it..

This was basicly to test if i could call the variable $file from within java correcly since a j++class needs to call and parse it for differant things and visa versa to delete the file if not correcly. Thats why the alert(msg); -)