Re: Can't Upload ram file

From: Date: Fri, 18 Nov 2005 14:33:51 +0000
Subject: Re: Can't Upload ram file
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-40693@lists.php.net to get a copy of this message
<? $uploadDir = 'media/'; if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; // the files will be saved in filePath $filePath = $uploadDir . $fileName; $result = move_uploaded_file($tmpName, $filePath); if (!$result) { echo "Error uploading file"; exit; } if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $username=""; $password=""; $database=""; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO upload2 (name, size, type, path ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); include 'library/closedb.php'; echo "<br>File uploaded<br>"; } ?> On 11/18/05, Bastien Koert <bastien_k@hotmail.com> wrote: > > show code, maybe checks are being done to only allow images or certain > extensions... > > > Bastien > > > >From: Mohamed Yusuf <myainab@gmail.com> > >To: php-db@lists.php.net > >Subject: [PHP-DB] Can't Upload ram file > >Date: Fri, 18 Nov 2005 06:19:24 -0800 > > > >the script I am using can upload images like, jpg, gif or png to the > >server, > >but it can't upload music file to the server like ram and rm. > >any help? > > >

« previous php.db (#40693) next »