echo return TMP file name

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

echo return TMP file name

Post 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
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Fix it ;-) and some other small bugs ;-)


thanks for looking
Last edited by ol4pr0 on Fri Mar 19, 2004 4:13 pm, edited 1 time in total.
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

Code: Select all

<?php

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

?>
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post 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); -)
Post Reply