There are few options that you can change by editing the file itself:
-- `$settings['uploaddir'] = '.';`
+- `uploaddir => '.'`
Directory to store the uploaded files. Defaults to rurrect script directory
-- `$settings['listfiles'] = true;`
+- `listfiles => true`
Option that will list all files in uploads directory. Enabled by default
+- `debug => false`
+ To display debugging information
+
## Usage options
- Through interface:
- - Click on upload message
- - HTML5 Drag'and'Drop (via dropzone.js)
- - No Javascript HTML Form fallback
+ - Choose files via dialigue
+ - Drop files, via HTML5 drag'and'drop (using [dropzone.js](http://www.dropzonejs.com/))
+ - Basic HTML Form (if no JavaScript is suported)
- Upload using any compatible tool (like cURL)
This example will upload a file and copy URL to clipboard:
-
+
```bash
- curl -F "file=@$(pwd)/file.jpg" http://your-host/sharing/ > xclip -sel clip
+ curl -F "file=@file.jpg" your-host/sharing/ | xclip -sel clip
```
<?php
- $settings = array();
- // Directory to store the uploaded files
- $settings['uploaddir'] = '.';
- // List uploaded files
- $settings['listfiles'] = true;
+ // ============== Configuration begin ==============
+
+ $settings = array(
+
+
+ // Directory to store uploaded files
+ uploaddir => '.',
+
+
+ // Display list uploaded files
+ listfiles => true,
+
+
+ // Display debugging information
+ debug => false
+
+ );
+
+ // ============== Configuration end ==============
// Relative path to this file (don't edit)
$settings['scriptpath'] = $_SERVER['PHP_SELF'];
// Name of this file (don't edit)
$settings['scriptname'] = pathinfo(__FILE__, PATHINFO_FILENAME) . '.php';
+ // URL to upload page
+ $settings['pageurl'] = $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['REQUEST_URI']), '\\/');
+
+ // Displaying debug information
+ if ($settings['debug']) {
+ echo '<h1>Debugging information</h1>';
+ echo '<pre>';
+ print_r($settings);
+ echo '</pre>';
+ }
+
if (isset($_FILES['file']) && strlen($_FILES['file']['name']) > 1) {
$upload_file_name = basename($_FILES['file']['name']);
$uploadpath = $settings['uploaddir'] . DIRECTORY_SEPARATOR . $upload_file_name;