This repository contains a modern and responsive file upload application built with PHP and Tailwind CSS that allows users to upload files directly to Google Drive. The application features a clean user interface and a seamless upload experience with drag-and-drop functionality.
Clone the repository:
git clone https://github.com/vulct174/php-form-upload-files-with-tailwind-css.git
cd php-form-upload-files-with-tailwind-css
Install dependencies:
composer install
Set up Google API credentials:
credentials.json
in the root directoryConfigure your web server to serve the application.
You can modify the following files to customize the application:
index.html
: Main form layout and structureupload.php
: Backend processing and Google Drive API integration/
βββ index.html # Main HTML file with the form
βββ upload.php # PHP script for processing uploads
βββ credentials.json # Google API credentials (you need to add this)
βββ screenshot.png # Screenshot of the application
βββ README.md # This documentation
βββ vendor/ # Composer dependencies
The application uses the Google PHP Client Library to authenticate and upload files to Google Drive. Files are organized in folders based on the department selected by the user.
Key features of the Drive integration:
To add more form fields, update both the HTML form and the PHP processing script:
index.html
upload.php
to process the new fieldTo modify how files are organized in Google Drive, edit the folder creation logic in upload.php
.
Upload Fails: Check your credentials.json
file and ensure your Google API project has the Drive API enabled.
Permission Errors: Make sure your application has been authorized to access the user's Google Drive.
File Size Limitations: By default, PHP has upload size limitations. Check your php.ini
configuration.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by vulct174