ccrevcypsys Posted December 5, 2007 Share Posted December 5, 2007 Does any one out there know of any upload scripts that are secure and will upload a .mdb to replace the old one. I dont know how to do this yet... Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 5, 2007 Author Share Posted December 5, 2007 is there any way to even upload a .mdb file to a server???? Quote Link to comment Share on other sites More sharing options...
Guest Posted December 5, 2007 Share Posted December 5, 2007 Hey, couldn't you do so via FTP? I figure it'd be faster than way than through an upload script. Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 5, 2007 Author Share Posted December 5, 2007 well the problem with that is the fact that this is for a client and we dont want here ftping around our servers. so i need to have it so that she can just upload it... Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted December 5, 2007 Author Share Posted December 5, 2007 I am now trying to just copy it into the folder but it isnt working.. is this script right if ($_FILES['mdb'] != "") { copy($_FILES['mdb']['tmp_name'], "../db/".$_FILES['mdb']['name']) or die("Couldn't copy the file!"); } else { die("No input file specified"); } Quote Link to comment Share on other sites More sharing options...
Guest Posted December 5, 2007 Share Posted December 5, 2007 Oh ok, I see. And you've got it somewhat right. Just to clarify: you need two parts for a file upload script: A file upload form like so in form.html <form action="script.php" method="POST" enctype="multipart/form-data"> File to upload: <input type="file" name="mdb"><br /> <input type="submit" value="Press"> </form> in script.php <?php if(! file_exists($_FILES['mdb']['tmp_name']) ){ die('No file uploaded'); } if(! move_uploaded_file($_FILES['mdb']['tmp_name'], '../db/'.$_FILES['mdb']['name']) ){ echo 'File successfully uploaded'; } ?> Now this is a very simple uploader, but it should work. I'm running on an hour of sleep, so I hope I didn't get something wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.