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... Link to comment https://forums.phpfreaks.com/topic/80343-upload-script/ 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???? Link to comment https://forums.phpfreaks.com/topic/80343-upload-script/#findComment-407232 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. Link to comment https://forums.phpfreaks.com/topic/80343-upload-script/#findComment-407236 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... Link to comment https://forums.phpfreaks.com/topic/80343-upload-script/#findComment-407249 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"); } Link to comment https://forums.phpfreaks.com/topic/80343-upload-script/#findComment-407254 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. Link to comment https://forums.phpfreaks.com/topic/80343-upload-script/#findComment-407313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.