bftwofreak Posted January 15, 2009 Share Posted January 15, 2009 Whenever I upload a file using the following php script, everything processes correctly and I get the dialog that says that the file uploaded correctly... however, the file does not show up in any directory... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 15, 2009 Share Posted January 15, 2009 What script? Whenever I see a post where something was mistakenly left out and it was not reviewed by the OP at any point during or after it was posted to discover and correct that mistake, I am reminded of the original Star Trek episode called the "Changeling" where the Nomad probe mistakes Captain Kirk as its' creator, fails to discover its mistake, and fails to correct its mistake - "Must analyze, analyze, sterilize, sterilize, ... [explosion in deep space]" Quote Link to comment Share on other sites More sharing options...
bftwofreak Posted January 21, 2009 Author Share Posted January 21, 2009 <?php error_reporting(E_ALL); if ($_POST['rand'] == 'updom') { if ($_FILES['file']['error'] > 0) { echo 'An error has occured'; } else { $target_path = $_SERVER['DOCUMENT_ROOT'] . '/uploads/'; $name = $_POST['name']; $target_path = $target_path . $name; move_uploaded_file($_FILES['file']['tmpname'],$target_path); echo basename($_FILES['file']['name']) . ' has been uploaded successfully'; } } else { echo '<form method="post" enctype="multipart/form-data" > <input type="hidden" name="rand" value="updom" /><br> Filename: <input type="text" name="name" value="" /><br> File: <input type="file" name="file" /><br> <input type="submit" value="Upload" /> </form>'; } ?> My mistake but you don't have to be an ass... I understand that you are a senior programmer, but why be a bastard to the rest of the forum community? Here's the code if anyone else wishes to assist me. Much appreciated 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.