Jump to content

[SOLVED] uploaded file name


ballouta

Recommended Posts

Hi, i have this code that uploads a file.

I want to store the file name in a avariable to update the table records..

how?

 

Thank you

 

<?php
$target_path = "/home/username/public_html/files/";

$target_path = $target_path . basename($_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). " has been uploaded<br> <a href='index.htm'> Go back to HOME</a><br>";
} else{
    echo "There was an error uploading the file, please try again!<br><a href='index.htm'> Go back to HOME</a><br>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/144042-solved-uploaded-file-name/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.