On your upload.processor.php page, the file name of the uploaded file can be retrieved with:
You could add this to your redirect...Code:basename($uploadFilename);
...and then translate it to a full URL on the success page:Code:header('Location: ' . $uploadSuccess.'?img='.basename($uploadFilename));
Code:<?php // filename: upload.success.php // make a note of the current working directory, relative to root. $directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']); // make a note of the directory that will recieve the uploaded files $uploadsDirectory = 'http://'.$_SERVER['HTTP_HOST'] . $directory_self . 'uploaded_files/'; ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <title>Successful upload</title> </head> <body> <div id="Upload"> <h1>File upload</h1> <p>Congratulations! Your file upload was successful</p> <p><?php echo $uploadsDirectory.$_GET['img'];?></p> </div> </body> </html>




Reply With Quote