ainbila Posted July 31, 2021 Share Posted July 31, 2021 (edited) is there any way to put function compress pdf file size in this code . Because when user upload big file size , it will get error . So , i'm looking code that can auto resize the pdf file in php $targetDir7= "folder/pda-semakan/bm/"; if(isset($_FILES['bmjulai'])){ $fileName7= $_FILES['bmjulai']['name']; $targetFilePath7 = $targetDir7 . $fileName7; $move8=move_uploaded_file($_FILES["bmjulai"]["tmp_name"], $targetFilePath7); } Edited July 31, 2021 by ainbila Link to comment https://forums.phpfreaks.com/topic/313458-auto-compress-when-upload-file-pdf-in-php/ Share on other sites More sharing options...
requinix Posted July 31, 2021 Share Posted July 31, 2021 You want to use PHP to compress the file... before it's uploaded? If you need to allow files of a certain size then change your PHP settings to allow files of a certain size. Link to comment https://forums.phpfreaks.com/topic/313458-auto-compress-when-upload-file-pdf-in-php/#findComment-1588733 Share on other sites More sharing options...
ainbila Posted July 31, 2021 Author Share Posted July 31, 2021 because our server size is limited so i need to make sure file not to big size Link to comment https://forums.phpfreaks.com/topic/313458-auto-compress-when-upload-file-pdf-in-php/#findComment-1588734 Share on other sites More sharing options...
requinix Posted July 31, 2021 Share Posted July 31, 2021 Locking because your other thread covers this same topic. Link to comment https://forums.phpfreaks.com/topic/313458-auto-compress-when-upload-file-pdf-in-php/#findComment-1588743 Share on other sites More sharing options...
Recommended Posts