سؤال

I have a php page that creates txt files using fwrite which are then uploaded to a directory on the server. I also have a mysql database that the URL for the file is written to, is it possible to get the file size of the said file and add this to the database? If so, how?

هل كانت مفيدة؟

المحلول

after you save your file you know the path of the file try to get normally the filesize

$filename = 'directory_upload/somefile.txt';
$filesize = filesize($filename);

نصائح أخرى

You could try the filesize() function.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top