Download the PHP package popphp/pop-file without Composer

On this page you can find all versions of the php package popphp/pop-file. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pop-file

pop-file

END OF LIFE

The pop-file component v2.1.0 is now end-of-life. The upload and dir sub-components have been forked and pushed into other repositories, respectively:

Build Status Coverage Status

OVERVIEW

pop-file is a component for managing file uploads and easily traversing files within a directory. With file uploads, you can set fine-grain controls to manage specific upload parameters like file types and file size. Also, you can traverse directories recursively as well.

pop-fileis a component of the Pop PHP Framework.

INSTALL

Install pop-file using Composer.

composer require popphp/pop-file

BASIC USAGE

File uploads

Basic file upload

The above code creates the upload object, sets the upload path and sets the basic defaults, which includes a max file size of 10MBs, and an array of allowed common file types as well as an array of common disallowed file types.

File upload names and overwrites

By default, the file upload object will not overwrite a file of the same name. In the above example, if $_FILES['file_upload']['name'] is set to 'my_document.docx' and that file already exists in the upload path, it will be renamed to 'my_document_1.docx'.

If you want to enable file overwrites, you can simply do this:

Also, you can give the file a direct name on upload like this:

And if you need to check for a duplicate filename first, you can use the checkFilename method. If the filename exists, it will append a '_1' to the end of the filename, or loop through until it finds a number that doesn't exist yet (_#). If the filename doesn't exist yet, it returns the original name.

Directory traversal

Traversing a directory

If you want to traverse the directory recursively and get the full path of each file.

The available boolean options for the $options array parameter are:

Emptying a directory

The true flag will remove the actually directory as well.


All versions of pop-file with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package popphp/pop-file contains the following files

Loading the files please wait ....