jkkenzie Posted April 12, 2014 Share Posted April 12, 2014 hi, i migrating an old CMS and there is something am not understanding: For some reason if magic_quotes_gpc is turned off, uploads dont work. Function below: function myupload($dir, $filein, $exclude=array(), $include=array(), $specs=array(), $det=array()) { if(is_array($filein)) { THIS IF RETURNS FALSE. I.E IT DOES NOT GO THROUGH HERE... IT JUMPS TO ELSE.. It seems the the $filein supplied to this function has a problem, though print_r show the value 1. $filein comes from the call below: myupload('../UserSiteFiles/'.rawurldecode($_POST['currentdir']), $_FILES['uploads']) WHAT happens to $_FILES and $_POST when magic_quotes_gpc=off ?? Thanks... Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 12, 2014 Share Posted April 12, 2014 magic_quotes wouldn't affect the $_FILES array in that way. it's likely your code leading up to that point is overwriting $_FILES['uploads'] with a 1. Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted April 12, 2014 Author Share Posted April 12, 2014 Thanks: The only clue i have is magic_quotes_gpc when it on uploads work. No particular error at the moment. Quote Link to comment Share on other sites More sharing options...
Solution jkkenzie Posted April 12, 2014 Author Solution Share Posted April 12, 2014 I cant believe it was just making the $_FILES an array: i dont know if this is right... array($_FILES['uploads']); if(myupload('../UserSiteFiles/'.rawurldecode($_POST['currentdir']), $_FILES['uploads'])){?> I just added... array($_FILES['uploads']); and it worked, file could be uploaded. 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.