LOLROB
10-02-2008, 11:37 PM
i am doing the next vertion of slimupload.com
and im a bit stuck on the upload script (its a realy simple one)
it all works but when it uploads it comes up as this
http://img156.imageshack.us/img156/7060/helpbd9.jpg
I would like to add the URL to the file the dir is /upload/
this is the part of the code wich needs editing its come thing to do with echo because i dont know much about it would any one help please :)
<?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path= "upload/".$HTTP_POST_FILES['ufile']['name'];
if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Successful<BR/>";
//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name :".$HTTP_POST_FILES['ufile']['name']."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
echo "<img src=\"$path\" \">";
}
else
{
echo "Error";
}
}
?>
+Rep to all help
Thanks :)
and im a bit stuck on the upload script (its a realy simple one)
it all works but when it uploads it comes up as this
http://img156.imageshack.us/img156/7060/helpbd9.jpg
I would like to add the URL to the file the dir is /upload/
this is the part of the code wich needs editing its come thing to do with echo because i dont know much about it would any one help please :)
<?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path= "upload/".$HTTP_POST_FILES['ufile']['name'];
if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Successful<BR/>";
//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name :".$HTTP_POST_FILES['ufile']['name']."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
echo "<img src=\"$path\" \">";
}
else
{
echo "Error";
}
}
?>
+Rep to all help
Thanks :)