{"id":15015351,"url":"https://github.com/awarmanf/file_sharing_cgi","last_synced_at":"2026-02-07T15:32:54.664Z","repository":{"id":256021247,"uuid":"854133044","full_name":"awarmanf/file_sharing_cgi","owner":"awarmanf","description":"The File Sharing is a web application to upload a file to a server  and sharing it with other users by emailing them the download link.","archived":false,"fork":false,"pushed_at":"2024-09-08T13:52:56.000Z","size":1285,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T14:27:40.504Z","etag":null,"topics":["cgi-application","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awarmanf.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-08T13:24:21.000Z","updated_at":"2024-09-08T13:52:59.000Z","dependencies_parsed_at":"2024-09-08T15:23:09.754Z","dependency_job_id":"ca97c8e9-0bdb-48fd-b45d-28d018d875c3","html_url":"https://github.com/awarmanf/file_sharing_cgi","commit_stats":null,"previous_names":["awarmanf/file_sharing_cgi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/awarmanf/file_sharing_cgi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Ffile_sharing_cgi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Ffile_sharing_cgi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Ffile_sharing_cgi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Ffile_sharing_cgi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awarmanf","download_url":"https://codeload.github.com/awarmanf/file_sharing_cgi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awarmanf%2Ffile_sharing_cgi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29198178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T14:35:27.868Z","status":"ssl_error","status_checked_at":"2026-02-07T14:25:51.081Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgi-application","perl"],"created_at":"2024-09-24T19:46:56.734Z","updated_at":"2026-02-07T15:32:54.639Z","avatar_url":"https://github.com/awarmanf.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# File Sharing (CGI Application)\n\nThe File Sharing is a web application written in Perl CGI to upload a file to a server \nand sharing it with other users by notifying them the download link.\n\nUsually people send a file through email as an attachments. Attachments can be any type of \nfile, such as documents, images, or videos, and used for sharing information between \nindividuals or teams. Email services have limits on the size of attachments that can be sent. \nSuch as Gmail has a capacity up to 25 MB in the email attachment.\n\nIf a user send a file to a group of people with the same domain then the server mail will keep \nit per account basis. For example if you send a file to a group of 5 accounts with the same domain \nthen the server mail must allocate storage for 5 x the file size to keep that files. That wastes of storage.\n\nInstead of sending file via email attachment, a user can upload it to another storage like NAS or\nNetwork Access Storage then he / she can notify who needs it via email message which contain a \nlink to download.\n\n## Requirement\n\nYou must install web server (httpd or nginx), mysql and perl cgi.\n\nPackages installation in CentOS 5.11.\n\nHttpd and perl\n\n    yum install httpd openssl mod_ssl mod_perl\n\nPerl Modules\n\n    yum install perl-File-Slurp-Tiny perl-JSON perl-CGI-Session perl-File-Slurp perl-Crypt-CBC perl-Crypt-OpenSSL-Random \\\n      perl-Crypt-OpenSSL-RSA perl-Crypt-OpenSSL-AES perl-Convert-PEM perl-Email-Valid perl-HTML-Template perl-DBD-CSV perl-Authen-SASL \\\n      perl-Crypt-RC4 perl-DateTime perl-File-MimeInfo\n\nPHP, Perl and LDAP\n\n    yum install mysql php nss_ldap php-ldap perl-LDAP php-gd perl-DBD-MySQL perl-DBD-SQLite perl-DBD-AnyData mysql-server php-mysql libdbi-dbd-mysql\n\n## Basic Configuration\n\n### Edit file /etc/httpd/conf/httpd.conf\n\nEdit file `/etc/httpd/conf/httpd.conf`\n\n    ...\n    Options FollowSymLinks IncludesNoExec +ExecCGI\n    ...\n    DirectoryIndex index.html index.html.var index.cgi\n    ...\n    AddHandler cgi-script .cgi\n\nRestart httpd.\n\n### Test if CGI is working\n\nSave the file `test.cgi` to the root html directory `/var/www/html`.\n\nThen make executable\n\n```\nchmod 755 /var/www/html/test.cgi\n```\n\nTest if cgi is working by using curl\n\n    curl http://localhost/test.cgi\n\nThe output\n\n```html\n\u003chtml\u003e\u003chead\u003e\u003ctitle\u003ePerl Environment Variables\u003c/title\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1\u003ePerl Environment Variables\u003c/h1\u003e\nDOCUMENT_ROOT = /var/www/html\u003cbr\u003e\nGATEWAY_INTERFACE = CGI/1.1\u003cbr\u003e\nHTTP_ACCEPT = */*\u003cbr\u003e\nHTTP_HOST = localhost\u003cbr\u003e\nHTTP_USER_AGENT = curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5\u003cbr\u003e\nPATH = /sbin:/usr/sbin:/bin:/usr/bin\u003cbr\u003e\nQUERY_STRING = \u003cbr\u003e\nREMOTE_ADDR = 127.0.0.1\u003cbr\u003e\nREMOTE_PORT = 46564\u003cbr\u003e\nREQUEST_METHOD = GET\u003cbr\u003e\nREQUEST_URI = /test.cgi\u003cbr\u003e\nSCRIPT_FILENAME = /var/www/html/test.cgi\u003cbr\u003e\nSCRIPT_NAME = /test.cgi\u003cbr\u003e\nSERVER_ADDR = 127.0.0.1\u003cbr\u003e\nSERVER_ADMIN = root@localhost\u003cbr\u003e\nSERVER_NAME = localhost\u003cbr\u003e\nSERVER_PORT = 80\u003cbr\u003e\nSERVER_PROTOCOL = HTTP/1.1\u003cbr\u003e\nSERVER_SIGNATURE = \u003caddress\u003eApache/2.2.3 (CentOS) Server at localhost Port 80\u003c/address\u003e\n\u003cbr\u003e\nSERVER_SOFTWARE = Apache/2.2.3 (CentOS)\u003cbr\u003e\n\u003c/body\u003e\u003c/html\u003e\n```\n\n### Create application directory\n\nThe web application will be kept on the root html directory `/var/www/html`.\nGo to the root html directory and extract the file `app-full.zip`.\n\n    cd /var/www/html\n    unzip app-full.zip\n\n### Create directory for file storage\n\nYou can keep the uploading files to local directory at the server web.\n\n    mkdir -p /data/upload\n\nChange ownership of that directory to owner of the httpd server, in this case is apache.\n    \n    chown apache /data/upload\n\n\u003eYou can mount a shared NFS directory on a particular mount point in the local directory.\n\n### Create database smscgi\n\nLogin to mysql as user root\n\n```sql\nCREATE DATABASE webupload;\nCREATE USER 'user1'@'localhost' IDENTIFIED BY 'password1';\nGRANT ALL PRIVILEGES ON `webupload` . * TO 'user1'@'localhost';\nEXIT;\n```\n\nThen execute sql statements to import file `webupload.db`.\n\n```\nmysql -u user1 -p webupload \u003c webupload.db\n```\n\n## Script Configuration\n\nYou can edit the value or constants at module `/var/www/html/app/My/Session.pm`.\n\n    # Directory\n    use constant UPLOADDIR =\u003e '/data/upload';\n    use constant EMAILALL  =\u003e '/var/www/html/app/data/emails.all.txt';\n    use constant EMAILLIST  =\u003e '/var/www/html/app/data/emails.list.txt';\n    use constant SESIDIR   =\u003e '/var/www/session';\n    use constant IDLEXPIRE =\u003e 3600; # '+1h' or 3600 seconds\n    use constant EXPIRE    =\u003e '+1d';\n    use constant LOGOUTEXP =\u003e 'Thu, 01-Jan-1970 00:00:00 GMT';\n    use constant LOGINPAGE =\u003e 'index.cgi';\n    use constant QUOTAMAX  =\u003e 262144000; # 250 MB\n    # Maxiumum file size to upload also edit MAXFILESIZE on ../../html/js/functions.js\n    use constant MAXFILESIZE =\u003e 150; # 150 MB\n    # Set how many days file will be kept on the server (0 means will be keep forever)\n    use constant UPTIME =\u003e 120;\n    # Authentication using LDAP\n    use constant DOMAIN =\u003e 'domain.org';\n    use constant PROTOCOL  =\u003e 'LDAP';\n    use constant MAILSERVER =\u003e 'mail.domain.org';\n    # BCC\n    use constant BCC =\u003e 'admin';\n    # MySQL\n    use constant DB =\u003e 'webupload';\n    use constant HOSTDB =\u003e 'localhost';\n    use constant PORTDB =\u003e '3306';\n    use constant USERDB =\u003e 'user1';\n    use constant PASSDB =\u003e 'password1';\n\n### Email\n\n*EMAILALL* this refer to a file which contains all emails user plus all email distribution lists.\n\n*EMAILLIST* this refer to a file which contains all email distribution lists.\n\n### QuotaMax\n\n*QUOTAMAX* is a maximum storage in Bytes for a user to keep the file(s) on the server.\n\n### Max file size\n\n*MAXFILESIZE* is a maximum file size in MB a user can upload.\n\n### Uptime\n\n*UPTIME* is how long in days the file will be kept on the server before removed aumotically.\n\n\u003eYou should create a cronjob to remove the file(s) which has an access time more than UPTIME.\n\n### Authentication Method\n\nThere are two protocols that supported.\n\n- LDAP\n- POP3\n\n### BCC\n\nThis is the email address which will be get all the notification emails sent by user.\n\nThe rests are self explanatory.\n\n## How to Use The Application\n\n### Login to Application\n\nIn this example you can login using your email account.\n\n![Login](screenshots/00.png)\n\n### Choose the File to Upload\n\nYou choose the file to upload by click *Choose File* button.\n\n![Login](screenshots/01.png)\n\nAlternatively, if you already have some files on the server you can click *My File* button and select \none or more file(s). Then click *Send Selection* button, close the popup, finally click *Send Email* button.\n\n![Login](screenshots/06.png)\n\n### Upload the File\n\nClick the button *Upload File*.\n\n![Login](screenshots/02.png)\n\n### Successful Upload the File\n\n![Login](screenshots/03.png)\n\nThe file will be saved at the server include with the last modified time.\n\nYou can click *Send Email* button.\n\n### Send Email Notification\n\nSelect the email address on the left you want to email. Or you can select the distribution list email \nin the **boldface**.\n\nClick the button *Submit* to send the email(s).\n\n![Login](screenshots/04.png)\n\n### The Email is Being Delivered\n\n![Login](screenshots/05.png)\n\n### The Message on Your Inbox\n\nYou will get the notification email like this.\n\n![Login](screenshots/07.png)\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawarmanf%2Ffile_sharing_cgi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawarmanf%2Ffile_sharing_cgi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawarmanf%2Ffile_sharing_cgi/lists"}