Perfidus Posted December 4, 2009 Share Posted December 4, 2009 In my server, fwrite only works if I set an amount: fwrite($handle, $somecontent, '10000') //This works as long as the text is < 10000 fwrite($handle, $somecontent) //This only writes 3 or 4 characters. I have also problems with image uploading, the uploading process stops after some KB have been uploaded and they are not really much... Quote Link to comment https://forums.phpfreaks.com/topic/183955-server-configuration-fwrite-limited-by-default-to-3-or-4-characters/ Share on other sites More sharing options...
premiso Posted December 4, 2009 Share Posted December 4, 2009 How are you opening the file with fopen? I am not sure if it matters, but if you are specifying the bytes to open try leaving that off and see if you still get the issue. Quote Link to comment https://forums.phpfreaks.com/topic/183955-server-configuration-fwrite-limited-by-default-to-3-or-4-characters/#findComment-971590 Share on other sites More sharing options...
Perfidus Posted December 6, 2009 Author Share Posted December 6, 2009 Sorry, I don't understand you. This is how my code looks, the fopen has nothing special on it, does it? Can you explain it to me? This code comes from the PHP manual ... if (is_writable($filename)) { if (!$handle = fopen($filename, 'w')) { echo "Impossible to edit"; exit; } if (fwrite($handle, $somecontent, '10000') === FALSE) { echo "Can't update file"; exit; } echo "file was updated"; fclose($handle); } else { echo "Problem writing to file"; } Quote Link to comment https://forums.phpfreaks.com/topic/183955-server-configuration-fwrite-limited-by-default-to-3-or-4-characters/#findComment-972286 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.