DSG
DSG

Reputation: 43

Upload gif images to the server without lossing animation using PHP

I have used image upload class for a PHP web application and it works fine with jpg and png. But when I upload gif images they loss their animation. If anybody has idea about this please guide me through.

Upvotes: 3

Views: 2104

Answers (1)

Gayan
Gayan

Reputation: 2935

move_uploaded_file function work with gif without issues..

You can try this code,

<?php
if(isset($_POST['submit'])){
    move_uploaded_file($_FILES['file']['tmp_name'], $_FILES['file']['name']);
}
?>


<form action="" method="POST" enctype="multipart/form-data">
  <input type="file"name="file"/>
  <input type="submit" name="submit" value="submit"/>
</form>

Upvotes: 3

Related Questions