Giter Club home page Giter Club logo

php-progressive-fileuploader's Introduction

php-progressive-fileuploader

PHP simple file uploader with Progress Bar

####Installation procedure

Generic installation through pecl repository

pecl install uploadprogress

Ubuntu

apt install uploadprogress

Change below details in php ini settings to upload bigger file

upload_max_filesize 2G #2GB
post_max_size 3G #3GB

Add below details in php.ini at the end of line

extension=uploadprogress.so
[uploadprogress]
uploadprogress.get_contents=On
uploadprogress.file.filename_template=/tmp/upt_%s.txt
uploadprogress.file.contents_template=/tmp/upload_contents_%s

Restart Apache2

sudo service apache2 restart

Restart nginx

sudo service nginx restart

Check the changes has been applied in php settings post server restart using phpinfo() ####uploadprogress


uploadprogress support	enabled
Version                 1.1.3
Directive	                            Local Value	                Master Value

uploadprogress.file.contents_template	/tmp/upload_contents_%s	    /tmp/upload_contents_%s
uploadprogress.file.filename_template	/tmp/upt_%s.txt	            /tmp/upt_%s.txt
uploadprogress.get_contents	            1	                        1

Prepare the HTML form as follows, do not change the variable name "UPLOAD_IDENTIFIER" also do not change the priority of form elements. file input field should comes after UPLOAD_IDENTIFIER hidden field.

<form action="upload.php" method="POST" enctype="multipart/form-data" id="upload_form">
    <input type="hidden" name="UPLOAD_IDENTIFIER" id="UPLOAD_IDENTIFIER" value="<?php echo md5(uniqid(mt_rand())); ?>"/>
    <input type="file" name="uploaded_file"/>
    <!-- Any additional required form fields can be added below-->
    <input type="submit" value="Upload File"/>
</form>

Feel free to customize yourself anything...

php-progressive-fileuploader's People

Contributors

karthikeyanphp avatar phpcodemaker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.