GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - code-lts/resumable.php: PHP backend for resumable.js

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

139 Commits
139 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
composer.json
composer.json
 
 
phpcs.xml
phpcs.xml
 
 
phpunit.xml
phpunit.xml
 
 
readme.md
readme.md
 
 

Repository files navigation

PHP backend for resumable.js

To use this project we recommend you to use point cloud technology's fork that is a maintained version of the original resumable.js library.

Last tested version: @pointcloudtechnology/resumablejs:4.0.3.

Installation

To install, use composer:

composer require code-lts/resumable.php

How to use

upload.php

<?php
include __DIR__ . '/vendor/autoload.php';

use ResumableJs\Resumable;

// Any library that implements Psr\Http\Message\{ServerRequestInterface, ResponseInterface};
// See https://github.com/Nyholm/psr7 as a tested example

$resumable = new Resumable($request, $response);
$resumable->tempFolder = 'tmps';
$resumable->uploadFolder = 'uploads';
$resumable->process();

More

Setting custom filename(s)

$originalName = $resumable->getOriginalFilename(); // will give you the original end-user file-name

$mySafeName = Security::sanitizeFileName($request->query('resumableFilename'));
$resumable->setFilename($mySafeName);// Override the safe filename

// process upload as normal
$resumable->process();

// you can also get file information after the upload is complete
if (true === $resumable->isUploadComplete()) { // true when the final file has been uploaded and chunks reunited.
    $filename = $resumable->getFilename();
}

Removed features

  • $resumable->getOriginalFilename() does not have a parameter to return the name without the extension
  • $resumable->getExtension() implement the logic yourself
  • preProcess() no longer exists, it was not very useful
  • the default value of uploadFolder was test/files/uploads and is now uploads
  • Does not calculate the number of chunks, it uses the param resumableTotalChunks

Testing

$ ./vendor/bin/phpunit

About

PHP backend for resumable.js

web.archive.org/web/20211014061210/http://resumablejs.com/

Topics

resumable-uploadresumablejs

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.