mendoz Posted April 17, 2007 Share Posted April 17, 2007 yope Well... This is a simple upload script which fails to work on Internet explorer. May you tell me why? <?php // we connect to the database require("../conn.php"); // we get the id $id = $_GET['id']; // we get the file which has been uploaded ot not $userfile = basename($_FILES['uploadedfile']['name']); // we check if a file has been uploaded if (!empty($userfile)) { //This function separates the extension from the rest of the file name and returns it function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } //This applies the function to our file $ext = findexts ($_FILES['uploadedfile']['name']) ; //This just gives nanny5 etc $ran2 = "nanny".$id."."; //This assigns the subdirectory you want to save into... make sure it exists! $target_path = "../images/nannies/videos/"; //This combines the directory, the random file name, and the extension $target_path = $target_path . $ran2.$ext; // if it does not succed the tell the user if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { $uploadsql = "UPDATE `nannies` SET `vid`='".$ran2.$ext."' WHERE `id`=$id"; mysql_query($uploadsql,$connection); } else{ echo "There was an error uploading the file, please try again!"; } } ?> Link to comment https://forums.phpfreaks.com/topic/47421-simple-file-upload-works-only-with-firefox/ Share on other sites More sharing options...
mendoz Posted April 18, 2007 Author Share Posted April 18, 2007 bump, Link to comment https://forums.phpfreaks.com/topic/47421-simple-file-upload-works-only-with-firefox/#findComment-231880 Share on other sites More sharing options...
genericnumber1 Posted April 18, 2007 Share Posted April 18, 2007 maybe post your form as well? Link to comment https://forums.phpfreaks.com/topic/47421-simple-file-upload-works-only-with-firefox/#findComment-231889 Share on other sites More sharing options...
mendoz Posted April 18, 2007 Author Share Posted April 18, 2007 <?php $id = $_GET['id']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>TakeCareLinks.com - Control Panel</title> <link rel="stylesheet" href="css.css" type="text/css" /> </head> <body> <center> <br/><br/>Upload your video<br/> <form enctype="multipart/form-data" action="vidprocess.php?id=<?php echo $id; ?>" method="POST"> <input name="uploadedfile" type="file" /> <input type="submit"> </center> </body> </html> Link to comment https://forums.phpfreaks.com/topic/47421-simple-file-upload-works-only-with-firefox/#findComment-231890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.