Download the PHP package samsonphp/upload without Composer

On this page you can find all versions of the php package samsonphp/upload. 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 upload

SamsonPHP Upload module

Latest Stable Version Build Status Code Coverage Total Downloads Scrutinizer Code Quality Stories in Ready

Connection

To use this module in your project you must add dependency in your :

After doing or you will get all classes and functions of Upload module.

Configuration

Configuration for Upload module is not necessary, but you can use it if you want to create unique file name or upload dir name for uploading files.
If you will not use configuration, your upload catalog will be called 'upload' and file name will be random generated.

Thanks to SamsonPHP module/service configuration you can create simple config class:

Create async file uploading

The main feature of current module is asynchronous file uploading. Look at the example.

Example of HTML code

First of all you need to create html container with your file input:

Also you can add following feature blocks :

Remember, that you must add some css styles for this blocks to use them as you want.

Example of javascript code

If you are using input with class different from "__upload", you need to handle you inputs:

The second parameter in function is not necessary, you can use it for creating something special while file is uploading.

Example of uploading handler

Server action in our HTML example is controller 'catalog/upload'. Let's create this function:

To create file upload you need to create class \samsonphp\upload\Upload, constructor of which can have three parameters.

Method that directly create uploading called . You can get main file information using parameters of this method.

Also we can create our callback functions that are defined in configuration class:

As you see, we have parameter in our name handler function. This parameter is always defined as last parameter of this callback function.
In our case after created callback functions, upload catalog will be called 'upload/catalog5' and file name will be like 'item5'.
Don't forget, that in current example all uploading files will have simple name (maybe different extensions), so you must come up with some logic for using upload file name handler correctly.

Developed by SamsonOS.


All versions of upload with dependencies

PHP Build Version
Package Version
Requires samsonos/js_core Version *
samsonos/php_core Version 1.*
samsonphp/fs Version 1.*
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 samsonphp/upload contains the following files

Loading the files please wait ....