icecoolwas Posted September 26, 2008 Share Posted September 26, 2008 Whats wrong with this uploader script? Can you please fix it? Also disable PHP Uploading thanks im new to php but i know a little from html it makes me understand it better. <?php header('Content-type: application/vnd.wap.xhtml+xml'); ?> <?php echo '<?xml version="1.0"?' . '>'; ?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>PSPLime Uploader Script v1.00</title> </head> <body> <h1>Data Received at the Server</h1> <hr/> <p> <?php foreach ($_POST as $key => $value){ ?> <b>Name-value Pair Info:</b><br/> Field name: <?php echo $key; ?><br/> Field value: <?php echo $value; ?><br/><br/> <?php } $optionalFileName = $_POST['filename']; if ($_FILES['myFile']['error'] == UPLOAD_ERR_OK){ $fileName = $_FILES['myFile']['name']; ?> <b>Uploaded File Info:</b><br/> Content type: <?php echo $_FILES['myFile']['type']; ?><br/> Field name: myFile<br/> File name: <?php echo $fileName; ?><br/> File size: <?php echo $_FILES['myFile']['size']; ?><br/><br/> <?php /* Save the uploaded file if its size is greater than 0. */ if ($_FILES['myFile']['size'] > 0){ if ($optionalFileName == "") $fileName = basename($fileName); else $fileName = $optionalFileName; $dirName = '/uploads/'; if (move_uploaded_file($_FILES['myFile']['tmp_name'], $dirName . $fileName)){ ?> <b>The uploaded file has been saved successfully.</b> <?php } else{ ?> <b>An error occurred when we tried to save the uploaded file.</b> <?php } } } ?> </p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/125992-need-some-help/ Share on other sites More sharing options...
Maq Posted September 26, 2008 Share Posted September 26, 2008 What do you mean what's wrong with it? What are the errors? Do you have debugging on? Quote Link to comment https://forums.phpfreaks.com/topic/125992-need-some-help/#findComment-651530 Share on other sites More sharing options...
icecoolwas Posted September 26, 2008 Author Share Posted September 26, 2008 File uploaded succesfully, Error saving file to Upload folder (yes there is a upload folder) Quote Link to comment https://forums.phpfreaks.com/topic/125992-need-some-help/#findComment-651539 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.