Jump to content

Auto compress when upload file pdf in php


Recommended Posts


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 by ainbila
Link to comment
Share on other sites

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
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.