I use this upload form all of the time and use the same file name each time. I wonder if there is a way to set the file name in a form by changing the code and saving the file locally. If there other ways to automate this I'd be open to that too. Thanks.
Here is the source:
<html>
<body>
<form enctype="multipart/form-data" action="mibdata.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
Choose a file to upload: <input name="uploadedfile" type="file"/><br />
<input type="submit" value="Upload File" />
</body>
</html>
PHP Code: (in mibdata.php)
$target_path = "/path/to/save/file/filename.ext";
if(isset($_FILES['uploadedfile'])){
move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path);
}
Make sure that the target_path is writable by server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With