i'm trying to get a download link after a file is uploaded using "mini AJAX file upload form" mini-ajax-file-upload-form
i am trying to get this script to work with it but all the scipt does is upload it but i get no download link response.
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
$r = rand(1,100000);
$filename = $r . $_FILES["file"]["name"];
if (file_exists("upload/" . $filename)) {
echo "<center>";
echo $_FILES["file"]["name"] . " already exists. Please Rename your file and try again.</center><br>";
}
else
{
$link="$baseurl/upload/" . $filename;
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $filename);
echo "<center>Direct Download link: <a href=\"$link\">$link</a></center><br>";
can someone take a look at "mini AJAX file upload form" for me?
THANX!
Are you sure that the 'upload' directory has write permissions??
Next time, you can try to add these lines at the top of your code
ini_set('display_errors',1);
error_reporting(E_ALL);
If move_uploaded_file failed, it will always print out an error with detailed explanation.