One things you may encounter as a web developer is to write a code that uploads a file from the end-user's browser (the front-end) to the application server (back-end).
If you are using PHP as a back-end scripting language then this is straightforward.
These classes provides support for various customizations:
- maximum chunk size (like 1MiB)
- sending interval between chunks (like 20ms)
- maximum parallel chunks (like 10 chunks at a time)
- events that are triggered on starting a new chunk upload, on chunk sent, on upload progress, on upload error or on abort.
- it also provides support for sending a security nonce that the server script may validate it later.
The project hosted at GitHub provides also a demo implementation (see index.html) and a back-end demo script (see upload.php). Please note that you can find the classes full documentation on the project's GitHub repository.
Below it's a short diagram of how these files are related:
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Latest posts by Eugen Mihailescu (see all)
- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018