A simple php script to upload and download files. There is no complex user management as it aims for private file repository use. Supporting direct file deletion using AJAX, instant table sort using a self modified version of sorttable.js and finally upload file progressbar using a cgi(perl) script.
If you want to know more about those technologies, go to more information section.
Features
- Easy upload form
- Allow to define which kind of file can be uploaded
- Limit max file size
- On page table sort (by name, date, type, size)
- Direct deletion using AJAX
- View file by clicking on them
- Direct download by clicking on the download arrow
- Protect and hide upload or/and delete functions only for admin
- Logging upload/delete actions (time ip action)
- Upload progress bar (disable by default)
Online Demo
Visit the online demo. Delete the deleteme.txt file or upload some meaningless files.
How to Install
Download w2box 4.1 (~46 KiB)
License
This script is licensed under a Creative Commons License. It allows you to use and modify the script for noncommercial purposes only. If w2box solves your needs, please make a small donation. Thank you!
For commercial use, make a fair donation of at least €10 or more, especially if you using it on multiple domains or for contract work.
Changelog
- 4.1 Bug fixes, more languages and icons
- 4.0.0Beta5 Redirection and security fixes and more languages
- 4.0.0Beta4 More folders bug fixes
- 4.0.0Beta3 Folders bug fixes
- 4.0.0Beta2 Safari fix
- 4.0.0Beta Folder and multi language support
- 3.3.2 Security fix
- 3.3.1 Extention fix
- 3.3 Authentification fix for some host and cgi redirection fix
- 3.2 Fixed chmod issues, simplified directory structure and files
- 3.1.3 Improved upload.cgi error and aborted upload cleanup
- 3.1 Added icons, date and auto-deleting
- 3.0.3 Fixed file perms bug
- 3.0.2 Fixed direct linking
- 3.0.1 Fixed minor strange bug
- 3.0 Finally a upload progress bar (under windows&linux)
- 2.5.1 Fixed hide upload form
- 2.5 Easier configuration, localisation & many fixes
- 2.3 Possibilty to log upload and delete actions
- 2.2 Deletion is working for international charsets
- 2.1 Fixed some weird FF bug and allow client without javascript
- 2.0.1 Fixed a javascript bug for Opera
- 2.0 Added admin authorization to protect/hide upload/delete
- 1.6 Fixed issues with filename characters
- 1.5.2 Fixed some css bugs
- 1.5 Better error management, removed sajax using prototype.js
- 1.0 Initial Release
FAQ
I’ve just unpacked w2box and got an error 500 ?
It seems that some server configuration doesn’t support the .htaccess file. Just delete that file.
How to enable the upload progress bar ?
Enabling the progress bar can be a bit trickier. That’s why it is disabled by default. Before enable it, make sure the script works without it.
If it’s working, make sure the first line of upload.cgi is right according to where you have perl (on standard unix config, you probably don’t need to do anything) and the file will probably require to be chmod 755 in order to be executed. You can check if the perl script is working by opening it. You should get “CGI Working” like by example on my server.
If you don’t get an error, the default temporary dir is working. By default, it is set to “tmp” in the same folder as w2box. However, you might prefer to change it to a full path like /tmp or ~/tmp. Make sure to change it in both upload.cgi and config.php.
Finally, you can turn the variable upload_progressbar to true in config.php and hopefully it will works.
How could I password protect entriely w2box ?
The best was to protect the whole box and your files is to use apache http access protection. You can use this utility to make the required files. If you are using the admin feature, do not forget to add the admin username/password as a user in the htpassword file.
How to increase the maximum file size limit ?
By default the script is set to a maximum file size of 50MiB and use a .htaccess file to try to configure php to allow such maximum file size. However, if it doesn’t work you should modify the post_max_size & upload_max_filesize variables in php.ini which is the php configuration file. It is related to your webhost, therefore you should check with them if you are allowed to change them and how to do it.
Why files aren’t complete when using the downloading feature ?
There is an inherent problem with readfile() in PHP 5.0.4. Upgrade to the last version of php.
Why am I getting error 404 when I am accessing folders ?
Folders require the .htaccess file to work properly (which might be hidden depending your OS). Be sure that the .htaccess file is in the w2box folder and enable .htaccess support and mod_rewrite in your httpd.conf of the apache webserver.
Alternatives