Trouble uploading files in PHP

ZemsLemaories

New Member
I am trying to upload files using php, and it works perfectly up until 1Mb, I already checked the forum and saw that the common thing missing was to edit this values on php.ini (I am using WAMP):\[quote\] post_max_size = 8G upload_max_filesize = 2G\[/quote\]as you can see I already changed them up to Gigabytes and still it isn't working, what happens is that I click on upload and it goes to my upload.php file and just hangs in there writing nothing into the DB.I had this in my HTML but I commented it already:\[code\]<!--input type="hidden" name="MAX_FILE_SIZE" value="http://stackoverflow.com/questions/3742343/20000000000" /-->\[/code\]my upload php is:\[code\]<?phpinclude("mysql.class.php");$mysql = new MySQL();$tbl_name="documento";session_start();if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0){ $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); $myusername=$_SESSION['myusername']; if(!get_magic_quotes_gpc()){ $fileName = addslashes($fileName); } $query = "INSERT INTO $tbl_name (name, size, type, archivo,user_username ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content','$myusername')"; mysql_query($query) or die('Error, query failed'); echo "<br>File $fileName uploaded<br>"; header("location:admin.php");} ?>\[/code\]What am I missing here? Also, when I upload images (since 180kbs) and I download them to check they uploaded correctly I am not able to see the image however documents have no problem.
 
Back
Top