Archive for the ‘
File Upload ’ Category
It is easy to upload file when the Register_Globals are set to ON in the php.ini file (php configuration file) which is not recommended in any case for security reasons. When Globals are OFF then in this case I have tried this script and it works fine. Following is the script. Create two files. one html containing form and the other php file containing php script. This script will need a directory named as ‘img’ in root where this php script file is located according to the requirement of code. You can customize this code.
(more…)
By default there is a restriction of 2 Megabytes file upload at a time for PHP. If we have to upload media files or other large files then we will have to change some settings in php.ini.
- Locate the php.ini file in the folder your upload script resides in. If none exists, install a new php.ini file from the PHP config icon in cPanel. Then, use the File Manager to rename php.ini.default to php.ini
- In the php.ini file, locate the line called ‘upload_max_filesize = 2M’
- Modify that entry to read ‘upload_max_filesize = 10M’, or whatever your script requires. (M = megabytes)
(more…)
What this file does is uploads file in ‘temp’ folder then emails that attachment with message to a predefined email address and finally removes that file from temp folder. The idea is to send email in rich format but with file attachment.
Functionality
- Determine File Type to be attached
- Uploads file in temp directory and deletes file after email with attachment has been sent
- Emails uploaded file as an attachment
(more…)
This php script takes image file creates a thumbhnail and upload it into ‘thumb’ directory and also upload origional image with rename in ‘images’ directory.
Functionality
- Uploads image in the ‘images; directory and renames it
- Uploads thumbnail in ‘thumbs’ directory and renames it with thumb_filename
- Determine thumbnail max width and height
- Keeps aspect ratio of thumbnail size
- Allows jpg, jpeg and png image files
- Determines Max File Size allowed
- Displays thumbnail after uploading
(more…)
This script uploads the file in the same directory and give you some information about the file.
Functionality
- Uploads file in the same directory
- Gives information like file name, size in bytes and file type
- Determines Max File Size allowed
(more…)