Wasabi Direct Multipart File Transfer Documentation

Version 1.0.1 Last Documentation Update - 02/12/2020

Welcome

Thank you for purchasing Wasabi Direct Multipart File Transfer PHP Script. We covered almost everything in this document that how easily you can setup this script. We really do appreciate every sale. If you like our work please do not forget to rate it. It helps us in developing new and better cloud solutions.

Author: Berkine
Demo: Wasabi Direct Multipart File Transfer Demo
Admin Panel: Wasabi Direct Multipart File Transfer Admin Demo

Requirements

Before installation, your server must have following requirements to run the script properly
  • PHP v7.2 or higher
  • PHP Mbstring Extension
  • PHP PDO Extension
  • PHP JSON Extension
  • PHP CURL Extension
  • Support for MySQL v5.x
  • Wasabi Account with Root or Admin Level Access
  • Wasabi IAM User with Bucket Read and Write Access

PHP SDK (Version 3)

Wasabi uses AWS PHP SDK v3 which comes already included with the script, under - "vendor/aws" folder in the root directory of the app. And it is the offical latest AWS PHP SDK without any modification.

If you prefer to install AWS PHP SDK manually or to update to the latest version, you can get it from here: AWS PHP SDK Download

Installation Instructions

This is a general installation overview of the script, there is a deep dive section provided for each part in the left menu bar.

Follow the steps as explained, and you should be all set. If you face any challenges with installtion steps, reach out to us for a support.

Setup overview:

  • Step 1: Unzip Wasabi File Transfer to the root directory of your hosting - Ex: /var/www/html/. Which will make it reachable as follows: http://yourwebsitename/wasabi
  • Step 2: After unzipping files, run install.php file to configure your MySQL Database settings.
  • Step 3: (Optional) MySQL Database settings can also be configured manually as explained in notification.php file.
  • Step 4: Import the provided database/import_tables.sql database to the same database that you showed under DB Name in previous steps.
  • Step 5: (Optional) If step 2 was completed successfully and you were redirected to index.php page, you can delete install.php and notification.php files.
  • Step 6: Login into Admin Panel by visiting http://yourwebsitename/wasabi/admin/ page. Use following credentials to login: LOGIN: admin and PASSWORD: 123456. You can change your login and password in Admin Panel as needed.
  • Step 7: (Optional) Important: If you want the script to be accessible from any directory or from root directory, change /wasabi/ directory as needed, or remove it if you want to the script accessible directly at: www.yourwebsite.com.
    For accessing script under: www.yourwebsite.com/directoryname - replace 'wasabi' in the screenshots below as follows: '/directoryname/admin/'
    For accessing script under: www.yourwebsite.com - remove 'wasabi' completely, and it should like following: '/admin/'
  • 1 - Edit: admin/header.php file


    2 - Edit: admin/core/init.core.php file


  • Step 8: Include your Wasabi IAM Access Key and Secret Access Key Credentials under Wasabi Configuration page in Admin Panel. If you need to setup Wasabi Account and a bucket, visit Wasabi Setup page. Make sure you include your Bucket name as well and select correct Wasabi Region.
  • Step 9: If you want to see your Google Analytics data as shown in the demo example, follow the instructions under Google Setup page.
  • Step 10: For seting up SMTP configurations, follow the instructions under PHPMailer Setup page.
  • Step 11: Now you should be all set, enjoy the script!.

File Structure

General overview of included files:
  • Assets - All Client/server CSS and JS files
  • Classes - Entire script was written with OOP approach, all used classes are stored here
  • Core - Core settings and single file for all included files
  • Includes - Helper files for pages to call proper methods and run CRUD for DB
  • Pages - All Admin Panel pages are stored here
	
|   index.php
|   MultipartUpload.php
|
+---admin
|   |   footer.php
|   |   header.php
|   |   index.php
|   |   login.php
|   |   logout.php
|   |   navbar.php
|   |
|   +---assets
|   |   +---client
|   |   |   +---css
|   |   |   |       all.min.css
|   |   |   |       awselect.min.css
|   |   |   |       bootstrap.min.css
|   |   |   |       filepond.css
|   |   |   |       fontawesome.min.css
|   |   |   |       green-audio-player.css
|   |   |   |       intro.css
|   |   |   |       responsive-styles.css
|   |   |   |       styles.css
|   |   |   |
|   |   |   +---img
|   |   |   |       aws-white.png
|   |   |   |       aws.png
|   |   |   |       demo-audio.mp3
|   |   |   |       file.jpg
|   |   |   |       graph.svg
|   |   |   |       mb-bg-fb-04.jpg
|   |   |   |       preload.gif
|   |   |   |       record.png
|   |   |   |       recordz.png
|   |   |   |
|   |   |   +---js
|   |   |   |       awselect.min.js
|   |   |   |       bootstrap.min.js
|   |   |   |       custom.js
|   |   |   |       filepond-plugin-file-validate-size.min.js
|   |   |   |       filepond-plugin-file-validate-type.min.js
|   |   |   |       filepond.jquery.js
|   |   |   |       filepond.js
|   |   |   |       filepond.min.js
|   |   |   |       flipclock.min.js
|   |   |   |       green-audio-player.js
|   |   |   |       jquery-3.5.1.min.js
|   |   |   |       modernizr.js
|   |   |   |       moment.min.js
|   |   |   |       popper.min.js
|   |   |   |
|   |   |   \---webfonts
|   |   |           fa-brands-400.eot
|   |   |           fa-brands-400.svg
|   |   |           fa-brands-400.ttf
|   |   |           fa-brands-400.woff
|   |   |           fa-brands-400.woff2
|   |   |           fa-regular-400.eot
|   |   |           fa-regular-400.svg
|   |   |           fa-regular-400.ttf
|   |   |           fa-regular-400.woff
|   |   |           fa-regular-400.woff2
|   |   |           fa-solid-900.eot
|   |   |           fa-solid-900.svg
|   |   |           fa-solid-900.ttf
|   |   |           fa-solid-900.woff
|   |   |           fa-solid-900.woff2
|   |   |
|   |   \---server
|   |       +---css
|   |       |       all.min.css
|   |       |       animate.min.css
|   |       |       awselect.min.css
|   |       |       bootstrap.css
|   |       |       bootstrap.css.map
|   |       |       Chart.css
|   |       |       Chart.min.css
|   |       |       datatables.min.css
|   |       |       medical-icons.css
|   |       |       responsive-styles.css
|   |       |       styles.css
|   |       |
|   |       +---img
|   |       |       preload.gif
|   |       |
|   |       +---js
|   |       |       awselect.min.js
|   |       |       bootstrap.bundle.js
|   |       |       bootstrap.bundle.js.map
|   |       |       Chart.bundle.min.js
|   |       |       Chart.min.js
|   |       |       custom.js
|   |       |       datatables.min.js
|   |       |       jquery-3.5.1.min.js
|   |       |       jquery-3.5.1.min.map
|   |       |       loader.js
|   |       |       modernizr.js
|   |       |       moment.min.js
|   |       |       view-selector2.js
|   |       |       view-selector2.js.map
|   |       |
|   |       \---webfonts
|   |               fa-brands-400.eot
|   |               fa-brands-400.svg
|   |               fa-brands-400.ttf
|   |               fa-brands-400.woff
|   |               fa-brands-400.woff2
|   |               fa-regular-400.eot
|   |               fa-regular-400.svg
|   |               fa-regular-400.ttf
|   |               fa-regular-400.woff
|   |               fa-regular-400.woff2
|   |               fa-solid-900.eot
|   |               fa-solid-900.svg
|   |               fa-solid-900.ttf
|   |               fa-solid-900.woff
|   |               fa-solid-900.woff2
|   |
|   +---classes
|   |       Config.class.php
|   |       Cookie.class.php
|   |       DB.class.php
|   |       Email.class.php
|   |       GA.class.php
|   |       Hash.class.php
|   |       Input.class.php
|   |       Redirect.class.php
|   |       Wasabi.class.php
|   |       Session.class.php
|   |       Token.class.php
|   |       TranscribeMedical.class.php
|   |       User.class.php
|   |       Validate.class.php
|   |
|   +---core
|   |       init.core.php
|   |
|   +---database
|   |       import_tables.sql
|   |
|   +---includes
|   |   |   calculatetranscribecost.inc.php
|   |   |   calculatetranscribeseconds.inc.php
|   |   |   changeadsense.inc.php
|   |   |   changewasabicredentials.inc.php
|   |   |   changegooglecredentials.inc.php
|   |   |   changepassword.inc.php
|   |   |   changeuploadsettings.inc.php
|   |   |   cron.inc.php
|   |   |   googleanalytics.inc.php
|   |   |   sanitize.inc.php
|   |   |   smtpsettings.inc.php
|   |   |   smtptest.inc.php
|   |   |   tableactions.inc.php
|   |   |   tablefilesprocess.inc.php
|   |   |   tableresultsprocess.inc.php
|   |   |   tabletodaysprocess.inc.php
|   |   |   updateprofile.inc.php
|   |   |
|   |   \---errors
|   |           404.php
|   |
|   +---pages
|   |   +---analytics
|   |   |       analytics.page.php
|   |   |       cloudwatch.page.php
|   |   |
|   |   +---data
|   |   |       files.page.php
|   |   |       results.page.php
|   |   |
|   |   +---marketing
|   |   |       adsense.page.php
|   |   |
|   |   \---settings
|   |           wasabicredentials.page.php
|   |           google.page.php
|   |           password.page.php
|   |           profile.page.php
|   |           smtp.page.php
|   |           upload.page.php
|   |
|   \---vendor
|       +---aws
|       +---google
|       \---phpmailer
\---pages
        transcribe-file.php
        transcribe-record.php

Database Setup in phpMyAdmin

To run admin panel properly and fetch the application usage data and to set the settings you will need to setup local MySQL database.

All the necessary tables are provided in the root directory of the application, under database folder in a file called database.sql. You will need to import it into your existing or new database.

How to Import Database in phpMyAdmin:

  • Step 1: Login into phpMyAdmin.
  • Step 2: Click on New button to create a new database.
  • Step 3: Provide database name and select utf8_general_ci as collation and click create button.
  • Step 4: After the new database is created, select Import tab and select database.sql file that comes with the application in database folder, and click on Go button.
  • Step 4: Tables in your newly created database should look like this.


After you have your Database Environment setup, run install.php file:

It will create a new file called dbconfig.core.php under admin/core folder..

  • In install.php file:
  • Set mysql db host address.
  • Set mysql db username.
  • Set mysql db password.
  • Set mysql database name.

Wasabi Account Creation

Getting started with Wasabi. If you already have Wasabi Account, skip to next section.

How to Create Wasabi Account:

  • Step 1: Open the Wasabi home page.
  • Step 2: Choose the TRY or BUY Now button.
  • Step 3: Enter your account information, and then choose Continue. Be sure that you enter your account information correctly, especially your email address. If you enter your email address incorrectly, you can't access your account.
  • Step 4: Enter your first and last names. And, enter your email address at which you will receive a free trial invitation.
  • Step 5: Enter your country.
  • Step 6: Select the amount of storage that you would require.
  • Step 7: Optionally, enter an offer code.
  • Step 8: Click START YOUR FREE TRIAL. Wasabi will email an invitation as your link to Wasabi. You can use your free trial to store up to 1 TB of storage for 30 days, without the requirement of a credit card.
  • Step 9: In your email (“You are invited to try Wasabi”), click Create Account to create your free trial account.
  • Step 10: Click to check that you have read and agree to the Wasabi Customer Agreement. A link to the Agreement is available below the Sign Up panel.
  • Step 11: Click SIGN UP.
  • Step 12: You are now ready to work with the Wasabi Management Console and add a bucket.
  • Step 13: IMPORTANT: Wasabi does not allow file donwloads via API if you are in trial mode

Wasabi New Access Key

You will need Access Keys to programmatically access your bucket.

Creating Access Key:

  • Step 1: Sign in to the Wasabi Console and select Accessk Keys on the left column.
  • Step 2: Click on Create New Access Key button on the top right corner and click Create for Root User.
  • Step 3: Download your access keys and store in secure place.
  • Step 4: Include your Access Key and Secret Access Keys in the Admin Panel under Wasabi Credentials.
  • Step 5: Make sure you include Bucket Name and select Wasabi Region accurately.
  • Wasabi Credentials

Wasabi Bucket Creation

You will need a Bucket with public read & write access in the region that you prefer.

A bucket is owned by the Wasabi account that created it. By default, you can create up to 100 buckets in each of your Wasabi accounts. If you need additional buckets, you can increase your account bucket limit to a maximum of 1,000 buckets by submitting a service limit increase. For information about how to increase your bucket limit, reach out to Wasabi Support Team.


Create a bucket:

  • Step 1: On the Wasabi menu, click Buckets and then click the CREATE BUCKET button.
  • Step 2: If you are a new user, you may see a screen such as the one below. You can click either blue CREATE BUCKET button.
  • Step 3: In the “Select Bucket Name” area, enter a unique DNS-compliant name for your new bucket. A bucket name can consist of 3 to 63 lowercase letters, numbers, periods, and dashes. The name must begin with a lower­case letter or number. The name cannot contain underscores, end with a dash, have consecutive periods, or use dashes adjacent to periods. And, the name cannot be formatted as an IP address (123.45.678.90).
  • Step 4: Select the region (geographic location) where you want the bucket to reside.
  • Step 5: If you have an existing bucket, a “Quick Setup” area is included on the Create Bucket panel. Optionally, you can copy the settings from an existing bucket. To do so, click in the “Quick Setup” area. A list of existing buck­ets is displayed
  • Step 6: Click CREATE BUCKET to create the new bucket and end this procedure.
  • Step 7: You can configure optional features are versioning, etc as needed. The new bucket is displayed on the Object Storage panel.

Google Analytics Tracking Configuration

Analyze in-depth detail about the visitors on your main frontend page.

Setup Google Analytics:

  • Step 1: Visit Google Analytics page.
  • Step 2: On the left menu select Admin.
  • Step 3: Click Create Property, **select Web and then Continue.**.

  • Step 4: After that it will appear screen with information for your website.
  • Step 5: Fill it and then click Create.
  • Step 6: After the tracking site tag is generated, copy and paste Tracking ID into the next step. It will be in the following format - UA-XXXXXXXXX-X
  • Step 7: Include Tracking ID into Google Analytics Tracking ID field in Admin Panel under Google Settings and click Save Changes button.

Google Analytics Service Account

In order to use Google Analytics APIs you will need to enable Google Analytics API and get Service Account credentials in JSON format.

Setup Google Analytics Service Account:

  • Step 1: Go to the Google API Console, click on Library tab on the left. Search for Google Analytics API and Enable it.
  • Step 2: Open the Service accounts page. If prompted, select your existing project or create a new one.
  • Step 3: Click + Create Service Account, enter a name and description for the service account. You can use the default service account ID, or choose a different, unique one. When done click Create.

  • Step 4: After your service account is created, click on Action button(triple dots) and select Create key.
  • Step 5: Select Key type in JSON format and click Create, it will save JSON file on your local file system.
  • Step 6: Upload newly create JSON Key type to Admin Panel under Google Settings as shown below and click Save Changes button.

Google Maps API Key

To use the Maps JavaScript you must have an API key. The API key is a unique identifier that is used to authenticate requests associated with your project for usage and billing purposes.

To Get a Maps API Key:

  • Step 1: Go to the Google API Console
  • Step 2: Click the project drop-down and select or create project for which you want to add an API key and give it a project name.
  • Step 3: If you are using Google API for the first time you will see this screen after creating the project:
  • Step 4: Click Enable Apis and Services button or select Library button on the left.
  • Step 5: Find Maps JavaScript API and enable it as shown below.
  • Step 6: Click the menu button and select Credentials and click Create credentials > API key.
  • Step 7: The API key created dialog displays your newly created API key. Copy and paste it as shown in Step 8. The new API key is listed on the Credentials page under API keys.


    Important: Remember to restrict the API key before using it in production.
  • Step 8: Include the API key in Admin Panel under Google Settings > Google Maps API Key field and click Save Changes button.


Change application restrictions:

Depending on your server/domain configuration the script maybe won't accept the HTTP referrers restrictions so try with changing the application restrictions back to None





Enable Billing on your project:

Sometimes after adding the key these features maybe won't work again. Then depending on the google account associated with the project created and maybe you will need to enable Billing.

Learn more here about it: Billing or here Getting started with Google Maps Platform

Google Adsense Configuration

You can easily include your adsense script with admin panel.

Include Adsense Script:

Copy and paste your script for Left and Right columns in Admin Panel under Google Adsense settings and click save button. Make sure your adsense script has responsive feature turned on.

PHPMailer Configuration

For sending donwload links via email the latest version of PHPMailer is used, included under vendor folder in root directory.

All the SMTP settings can be configured and set in Admin Panel under SMTP Settings.

Required SMTP Settings:
  • SMTP Host
  • SMTP Port
  • SMTP Encryption
  • SMTP EMail Login
  • SMTP EMail Password
You can also add optional SMTP Settings:
  • From Email Address
  • From Name
  • Default Email CC

Include Required SMTP Settings and click Save Changes button:



You can also test your SMTP Settings immediately via Test Email Settings:




If you are planning to use Gmail for sending emails:

In your Gmail Account settings, under Security tab, make sure your Less secure app access feature is turned on.



Frontend Layout Configuration

Client side code uses only index.php file in the root directory to display the frontend.

Design Change:

To change the styles and functions of frontend you can customize following files as you prefer:
  • CSS
    • admin/assets/client/css/styles.css
  • JS
    • admin/assets/client/js/custom.css

Frontend Content Change:

Title, description and copyright information can be changed via Admin Panel under Frontend Layout tab.

Upload Configuration

Although Wasabi can potentially store unlimited number of files, your browser's parallel upload capability might be limited. The main limitation could be exceeding your stack with multipart chunk uploads.

Wasabi Multipart Upload Restrictions:

  • Maximum uploaded object size can be: 5TB
  • Maximum number of parts(file chunks) per upload: 10000. Important: It is strongly recommended to use bigger chunks for large files to avoid stack
  • Part size must be between 5MB and 5GB. There is no size limit on the last part of your multipart upload.
  • Maximum private signed link duration is: 7 Days

Default Settings Change:

You can change all default upload parameters and settings via Admin Panel under Upload Settings tab. Default change takes effect immediately and user will see them upon page refresh.

Accepted File Types has a special format that must be followed:
  • ['image/png', 'image/jpeg', ...] - Exact file types
  • ['image/*', 'audio/*', ...] - Grouped by file type category
  • [] - All file typess

Update v1.0.1

Released on 2nd December, 2020

Fixed:

  • Fix: Backend Adsense error fix
  • Fix: File counter graph display error fix
  • Fix: Upload traffic graph display error fix
  • Fix: Frontend minor bug fix

Updated:

  • Update: Documentation update with explanation of main directory change
  • Update: Documentation update with explanation of logo change

Initial Release v1.0.0

Released on 21st November, 2020