File Upload With AJAX: Handle file uploads and returns JSON response

Recommend this page to a friend!
  Info   Example   View files (4)   Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
56%Total: 615 All time: 5,042 This week: 228
Version License PHP version Categories
ajax-file-upload 1.0Freeware5PHP 5, Files and Folders, AJAX
Collaborate with this project Author

fileuploadwithajax - github.com

Description

This is a simple class that can handle file uploads and returns JSON response.

It can take the $_FILES array as parameter and checks if a file with a given input name was uploaded successfully.

If the file was received, it is moved to the uploads directory.

The class creates an array with the response details and outputs the array JSON encoded so it is easier for the JavaScript to handle.

The details include a success message with a download link, and the name of the file that was stored. If the upload fails, an error message is returned.

Recommendations

What is the best PHP AJAX file upload class?
I want to upload files using AJAX

Upload images using AJAX
Trying to upload avatar file

Picture of Bharat Parmar
  Performance   Level  
Name: Bharat Parmar <contact>
Classes: 11 packages by
Country: India India
Age: 29
All time rank: 58335 in India India
Week rank: 40 8 in India India
Innovation award
Innovation award
Nominee: 3x

Details

File Upload with AJAX

User can upload the file with AJAX. Once the file will be selected by User, the Script will confirm user to upload file or not. If user allow to upload file, it will be uploaded to the server and return the File Name and Download Link of the uploaded file.

Developed By :

Bharat Parmar

Version :

1.0

File Structure :

1) example.php : Example Script file 2) ajax.class.php : This file will upload the selected file to the "upload" directory. 3) upload : This directory will store uploaded files. 4) jquery.min.js : JQuery File for the AJAX and Javascript functions.

Requirements :

1) PHP Version : 3.0 and above

  Files  
File Role Description
js (1 file)
ajax.class.php Class Class file which includes file upload function
example.php Example Example file
README.md Data Plugin Description file

  Files  /  js  
File Role Description
   jquery.min.js Data Jquery File for ajax and javascript functions

 Version Control Unique User Downloads Download Rankings  
 100%
Total:615
This week:0
All time:5,042
This week:228
User Ratings User Comments (2)
 All time
Utility:80%
Consistency:75%
Documentation:-
Examples:90%
Tests:-
Videos:-
Overall:56%
Rank:1725
  

For more information send a message to info at phpclasses dot org.