2017 © Pedro Pelรกez
 

library cogiupload

Simple PHP class to upload/rename/resize files from a form

image

cogitium/cogiupload

Simple PHP class to upload/rename/resize files from a form

  • Thursday, December 15, 2016
  • by cogitium
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CogiMail - A simple-featured upload/rename and resize(later, not yet) class for PHP

Class Features

  • A simple code for uploading file from PHP
  • Upload, rename and eventualy resize (later, not yet) the file
  • Error messages in english only
  • Generate exception if a trouble appears
  • Compatible with PHP 5.0 and later

Why you might need it

Because it is really boring to develop this ;), (*1)

License

Coming soon., (*2)

Installation & loading

At the moment, you just have to copy the class file in the folder you want., (*3)

What's included

Within the download you'll find the following directories and files. You'll see something like this:, (*4)

cogiupload/
โ”œโ”€โ”€ bat/
โ”‚   โ”œโ”€โ”€ checkstyle.bat
โ”‚   โ”œโ”€โ”€ phpdoc.bat
โ”œโ”€โ”€ class/
โ”‚   โ””โ”€โ”€ CogiUpload.class.js
โ”œโ”€โ”€ doc/
โ”‚   โ”œโ”€โ”€ ...
โ”‚   โ””โ”€โ”€ index.html
โ”œโ”€โ”€ psr/
โ”‚   โ”œโ”€โ”€ ...
โ”‚   โ””โ”€โ”€ index.html
โ””โ”€โ”€ test/
    โ”œโ”€โ”€ testCogiUpload.php
    โ”œโ”€โ”€ image1.jpg
    โ”œโ”€โ”€ image2.gif
    โ”œโ”€โ”€ image3.png
    โ”œโ”€โ”€ image4.jpeg
    โ”œโ”€โ”€ fichier1.pdf
    โ”œโ”€โ”€ fichier2.doc
    โ””โ”€โ”€ uploads
        โ”œโ”€โ”€ ...
        โ””โ”€โ”€ ...

A Simple Example

setPathToUpload('uploads');
        //$upload->setNameForFile('mynewfile');

        /**
         * Process the file
         */
        $url = $upload->processUpload();
        ?>

        <h2>Upload done</h2>
        <div>
        <?php
        echo "<p>Very good, the upload is done !</p>";
        echo "<p>URL : " . $url. "</p>";
        $upload->debug();
        ?>
        </div>

        <?php

    } catch(Exception $e) {

        echo '<p>Exception : ' . $e->getMessage() . '</p>';
        $upload->debug();
    }
}
?>


Please select a file to upload


That's it. You should now be ready to use CogiUpload !, (*5)

Localization

English only at this time., (*6)

Documentation

The complete documentation is in the doc folder., (*7)

Tests

There is a test page in the test folder to try the component., (*8)

Contributing

An idea or a comment, please email to Philippe, (*9)

Changelog

See changelog., (*10)

History

  • At the beginning, CogiUpload was a procedural function in a PHP library.
  • Then, this function became a Class.
  • Now, CogiUpload is in a BitBucket repository.
  • With Readme, and a PhpDocumentor folder.
  • And Cherry on the Cake, there is a PSR folder to see the quality of the code ;-)

The Versions

15/12 2016

dev-master

9999999-dev https://bitbucket.org/cogitium/cogiupload

Simple PHP class to upload/rename/resize files from a form

  Sources   Download

MIT

by Philippe Giraud

upload resize

15/12 2016

1.0.0

1.0.0.0 https://bitbucket.org/cogitium/cogiupload

Simple PHP class to upload/rename/resize files from a form

  Sources   Download

MIT

by Philippe Giraud

upload resize