Giter VIP home page Giter VIP logo

uploady's Introduction

UPLOADY-removebg-preview

Quality Gate Status

Uploady

Uploady is a Simple File Uploader Script with Multi File Upload Support

It comes with more than 20 features and you can set up it in less than 5 minutes.

The software is written in PHP and uses MySQL as a database.

And it is free and open source.

Features

  1. Simple to use and implement
  2. 4 Protection levels
    • Mime Type
    • Extensions
    • Size
    • Forbidden names
  3. Out Of The Box Functions
  4. Bootstrap and jQuery over CDN
  5. Multi-File Upload Support
  6. Admin Panel with charts and stats
  7. Drag and Drop Support
  8. Role-based User Management with size limit for each role
  9. Data collection [IP Address, Browser Information, OS, Country]
  10. Image Manipulation
  11. AdSense Support
  12. Google Analytics Support
  13. Pages Management
  14. Multi-Languages Support
  15. Custom CSS and JS support
  16. Custom logo and favicon
  17. Delete files after x days
  18. Delete files after x downloads
  19. Report abuse page
  20. Social media sharing

Screenshots

Note

Change the permission of everything to 755 chmod 755 -R uploady/

How to Install

  1. Upload all files to your server
  2. Modify config/config.php with your custom info
  3. Change files and folders permission to 775
  4. Run install.php
  5. Enjoy (:

Docker Deployment

  1. Clone the project and cd into it
git clone https://github.com/farisc0de/Uploady
cd Uploady/
  1. Update config.php with connection string as below
define("DB_HOST", "db");
define("DB_USER", "uploady");
define("DB_PASS", "uploady");
define("DB_NAME", "uploady");
  1. Use the below to build the container and run it
docker-compose up -d

Wiki

  1. How to install on a shared hosting
  2. How to install with Docker

API Usage

curl --location 'http://localhost/api/upload' \
--header 'X-API-KEY: IpSznjueHn4vhi0BMhuZJRlk8epZxGJR' \
--form 'file=@"postman-cloud:///1eeafe05-7a96-4b40-9639-6ae17e7155d7"'

Click here for a real demo Uploady.NET

TODO

v4.0
1. Rewrite in Custom MVC
2. Report abuse dashboard
3. PhpFileUpload refactor
4. Upgrade Bootstrap to 5.3.3

License

MIT

Copyright

Developed by Faris AL-Otaibi - 2024

uploady's People

Contributors

cosmopolityan avatar emics avatar farisc0de avatar yohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uploady's Issues

Message : JSON Error

Hi,

I got this message after upload files.
IMG_20230715_081015

How to solve this problem.

Thank you.

syntax error, unexpected ')' in phpfileuploading/src/Upload.php

I'm trying to install your code on my server, but it does not work. I've uploaded your files (and set 777 on uploads/, however I forgot that during my first run), and I get redirected to /install.php in my browser. But this is just a blank page.

There is an error_log file in the server directory with [08-Nov-2023 14:28:56 UTC] PHP Parse error: syntax error, unexpected ')' in /home/xxx/public_html/yyy/vendor/farisc0de/phpfileuploading/src/Upload.php on line 222 .

I can't file see any wrong with parenthesis in this file. What could the problem be?

Your project looks great, so I want it up and running :)

An error when installing

Hello! I ran the docker commands like said in the setup, but when i open my domain /install.php fill out the details and click Install, i get this error:

Fatal error: Uncaught Error: Call to a member function prepare() on null in /var/www/html/src/Uploady/Database.php:121 Stack trace: #0 /var/www/html/vendor/farisc0de/phpmigration/src/Migration.php(77): Uploady\Database->prepare('CREATE TABLE IF...') #1 /var/www/html/logic/installLogic.php(189): Farisc0de\PhpMigration\Migration->createTable('users', Array) #2 /var/www/html/install.php(3): include_once('/var/www/html/l...') #3 {main} thrown in /var/www/html/src/Uploady/Database.php on line 121

Anything i should do?
I kinda suck with code haha

Missing instructions

Hello, just to clarify, you can't easily install and use the readme :

╰─$ docker build . -t farisc0de/uploady
docker-compose up -d
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/ubuntu/haproxy/uploady/Dockerfile: no such file or directory

Fixes

Add include_once 'init.php'; after include_once 'config/config.php'; in session.php otherwise

Undefined variable $allowed_pages
PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given

6fdc402

EDIT: Seems there's an issue
$allowed_pages doesn't have activate.php added to it, resulting in new users not being able to activate their accounts.

Adding activate.php to allowed_pages fixes the issue.

I'm assuming reset.php + forgot-password.php + expire.php also needs to be added to the same list otherwise unauthenticated users would not be able to reset their passwords

EDIT: After testing it out, I can't reset my password regardless as it endlessly states Your token has expired. Please try again.

Update:
The issue is
return $this->isExpired($token) ? false : true;
in isExist, 'Return true if the token exists otherwise false' - yet if the token is Not expired, it returns false, and if it is expired it returns true.

To refine this further, the issue is actually
function isExpired - Return true if the token expired otherwise false yet it returns false if the token is expired otherwise it returns true, swap around the true/false's in isExpired to fix it and the issue is resolved

also,

forgot-password.php can be accessed even if you're signed in

Also add maintenance.php to allowed_pages , otherwise unauthenticated users get redirected to login.php which sends to maintenance.php which gets sent to login.php, so on and so forth

Slight bug: when maintanence mode is enabled, and then I get signed out, I cannot sign in to disable maintanence mode

Another bug: Warning: Undefined array key "delete_files_success" in profile/my_files.php on line 23
Another: if you input a invalid file_id on edit.php, many warnings instead of a proper handling of the issue(Attempt to read property "file_data" on false) whereas delete.php handles improper file_id correctly

Another bug: Max filesize is set to 256mb regardless of settings , its done via Dropzone,
in upload.js set maxFilesize: 1024, // in MB -- not sure exactly how I'd go about changing it to the Role's max, but i suppose since that's done server side it is unnecessary, just set a 5gb limit and if the user role doesn't allow it, it'll be rejected

Also a way to have this functional would be ideal
chunking: true, chunkSize: 10000 * 1024,
Because otherwise this error will occur with big files: 413 Request Entity Too Large (cloudflare limits to 100mb)
But I tried it, and it does Not work! Instead, it ends up with multiple files being uploaded

Problems and missing features with installation and upload.

Hello, first of all, I would like to thank you for your efforts for this beautiful project work.
Let me get right to the point;

First of all, while creating a new table as I mentioned below on line 194 of ../logic/installLogic.php during the installation process, the table name is defined as  role .

$install->createTable("role", $role);

However, again on line 373 of ../logic/installLogic.php (and a few more lines) it is defined as  roles  as in the example I added below.

$install->insertValue("roles", [
            'id' => 2,
            'role' => 'User',
            'size_limit' => '150 MB',
        ]);

These differences cause the initial installation to fail.

Another problem is related to the  downloads  field, which is in the  files  table on line 58 of ../src/Uploady/Handler/UploadHandler.php but is not specified here.

The problem in this area is when uploading. Since the field does not have a default value when the table is first created, executing the code at line 64 after this code section results in an error that the file has no default value while saving it to the database. The file is uploaded but not saved in the database.

These are the problems I see so far. I hope I explained it in a proper and understandable English and it was useful for you.

I will not be able to use your project because it does not have the feature of specifying the file sharing period and the automatic deletion of the file at the end of this period, but I liked it. Built with a simple, beautiful configuration. Editing is easy.

Finally, thank you again for your work. Good luck.

Hello, first of all, I would like to thank you for your efforts for this beautiful project work.
Let me get right to the point;

First of all, while creating a new table as I mentioned below on line 194 of ../logic/installLogic.php during the installation process, the table name is defined as  role .

$install->createTable("role", $role);

However, again on line 373 of ../logic/installLogic.php (and a few more lines) it is defined as  roles  as in the example I added below.

$install->insertValue("roles", [
            'id' => 2,
            'role' => 'User',
            'size_limit' => '150 MB',
        ]);

These differences cause the initial installation to fail.

Another problem is related to the  downloads  field, which is in the  files  table on line 58 of ../src/Uploady/Handler/UploadHandler.php but is not specified here.

The problem in this area is when uploading. Since the field does not have a default value when the table is first created, executing the code at line 64 after this code section results in an error that the file has no default value while saving it to the database. The file is uploaded but not saved in the database.

These are the problems I see so far. I hope I explained it in a proper and understandable English and it was useful for you.

I will not be able to use your project because it does not have the feature of specifying the file sharing period and the automatic deletion of the file at the end of this period, but I liked it. Built with a simple, beautiful configuration. Editing is easy.

Finally, thank you again for your work. Good luck.

Chunked upload (HTTP)

Does this library use chunked upload in the background? If not, is it in the roadmap?

Install logic should detect environment mode

  • When we access /install.php, it should detect environment mode.
  • When in installation mode, proceed with install (current process already correct)
  • When in production mode, it should redirect to home (current process, still show install page)

A few issues

Non-docker! Just copied the PHP files and went.

If you're on signup.php , and you click the "TOS" (should be ToS I believe) -> it redirects back to login.php, making the ToS unreadable.
(I know "The page you are looking for does not exist. " even when you're able to access the ToS but still, just saying)

On signout, PHP message: PHP Warning: Undefined array key "redirect" in Uploady/logout.php on line 9

Also "Could not instantiate mail function. " on signup (i don't have emailing setup) but the point is, that is Not something that should be public facing. That's something that should be shown to an admin, not a member of the public trying to sign up. No logged error occurred so I would not have known of the issue if I didn't test it

Then after not verifying email and signing in, trying to upload an image, error.

PHP Warning:  fopen(/REDACTED.jpg): 
Failed to open stream: Permission denied in Uploady/vendor/farisc0de/phpfileuploading/src/Upload.php on line 748
PHP Fatal error:  Uncaught TypeError: stream_set_timeout(): 
Argument #1 ($stream) must be of type resource, false given in Uploady/vendor/farisc0de/phpfileuploading/src/Upload.php:751

fopen is trying to upload to the root directory .. ? /img.jpg , an absolute path, instead of the relative Uploady directory, or more specifically inside the uploads folder?

Line 748: $fp = fopen($this->upload_folder['folder_path'] . "/" . $filename, 'w');
configuration: define("UPLOAD_FOLDER", "uploads");
Maybe my configuration is to blame because it isnt /var/www/blah/blah/uploads , but still the Uploads.php file acted like this variable $this->upload_folder['folder_path'] was completely empty

Thanks for your time and effort! I'm really enjoying what you've created, if I have time I may try and contribute.

White blank PHP page

Hello
This project looks greate
But when I follow instructions for a Rasbian local installation...
http://up.bonnebulle.xyz/install.php
I have a white no error page

I already do :
chmod 755 -R uploady

Php upgrade
=> last v8 default + reboot
http://up.bonnebulle.xyz/phpinfo.php

config/config.php

<?php

// Database Settings
define("DB_HOST", "localhost");
define("DB_USER", "user_is_here");
define("DB_PASS", "password_is_here");
define("DB_NAME", "uploady");

// Application Settings
define("SITE_URL", "http://up.bonnebulle.xyz");
.  .  .

Mysql
CREATE DATABASE uploady
CREATE USER 'user_is_here'@'localhost' IDENTIFIED BY 'password_is_here;

Nginx

server {
   server_name up.bonnebulle.xyz;
   index index.php;
   root /path/uploady/;

    location ~ \.php$ {
        try_files      $uri =404;
        fastcgi_index  index.php;
        fastcgi_pass   unix:/run/php/php8.0-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

Maybe you can help me
I will retry tomorrow (following yt video)
Thanks

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'api_key' at row 1

Hello,

I'm having the error in subject while trying installing Uploady.

The install.php is showing the following:

PHP Version: 8.2.15
JSON: Installed
PDO: Installed
MySQL: Installed
Mbstring: Installed
uploads: Writable
config/config.php: Writable
config/environment.php: Writable

Everything on the system is ok, also created and granted a SQL user to the empty DB created for this application, but now just getting the error:

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'api_key' at row 1

Public uploads should be configurable

To avoid miss-used of the application by non responsible person, We need to force user to register before uploading. So it is very useful if there is a configurable setting in admin page to enable/disable public uploads.

reportabuse

So, I've set SMTP settings for gmail,

No errors at all, so I made a modification in Mailer.php
Adding error_log($th->getMessage()); after catch (Exception $th) { in sendMessage

"PHP message: SMTP Error: Could not authenticate" -> weird.
This issue is on my end, not the codes end but I want to point out:

This was all while reportabuse.php is showing Your report has been submitted successfully

So, log errors in some form + why not display if there was "an internal server error" that prevented the email from sending?

There's no errors if smtp is completely disabled either, so its something to think about

Apparently the issue I was having with authentication is due to this, switching to something like this worked just fine. Sorry for jumping

Also there was an issue I fixed here where the "Add Page"(manage pages) button was not functional due to there being no

element set(even though was set)
Why don't any default 'translations' exist for about/privacy/terms?

It would be kinda nice(but unnecessary ultimately) to be able to add 'allowed' file extensions beyond editing vendor/farisc0de/phpfileuploading/src/filter.json

  • Why are file names hashed? E.g. 'mantle.html' to '5d339950900db9ceb5cc40ae367419b44575a084.html' , is this something that can be a setting? Where is the component that changes the name? I'd definitely enjoy to modify it myself for my own instance but I haven't found it,
    I know of the functionality inside /src/Upload.php but I haven't narrowed it down to find the exact piece yet

Error Code: 500

Hello, I would like to thank you for the wonderful script you created, but I am having a problem installing it..

I uploaded the script files to the "public_html" folder on my vps service
When I access the page "https://mywebsite.com/install.php" the server returns with error 500
I tried everything with permission 775 but it still gives the same error

image

SQLSTATE[42000]: Syntax error or access violation:

Hello, on a new installation I am getting this error.

QLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' otp_secret varchar(255) NULL DEFAULT , failed_login int NOT NULL DEFAULT 0, ...' at line 1

PHP Version: 7.4.33
JSON: Installed
PDO: Installed
MySQL: Installed
Mbstring: Installed
uploads: Writable
config/config.php: Writable
config/environment.php: Writable

My server
Ubuntu 22.04 LTS

PHP version 7.4.33

MariaDB 10.6.7

Config not writable

Unable to proceed with installation due to config/config.php and config/environment.php not being writable. I've assigned permissions on the folders on both host machine and inside Docker, but to no avail. What could be wrong?
image

Here's the result of ls -l (more files above screenshot, irrelevant)
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.