PHP Classes

Upload images using AJAX: Trying to upload avatar file

Recommend this page to a friend!
  All requests RSS feed  >  Upload images using AJAX  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Upload images using AJAX

Edit

Picture of Marc Covert by Marc Covert - 9 years ago (2016-02-27)

Trying to upload avatar file

This request is clear and relevant.
This request is not clear or is not relevant.

+7

I am trying to upload avatar file using AJAX.

Ask clarification

3 Recommendations

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

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.
This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Bharat Parmar by Bharat Parmar package author package author Reputation 455 - 9 years ago (2016-04-11) Comment

This class will upload the any image file with ajax on selection of the file.


PHP Multi File Uploader: Validate and process one or more file uploads

This class can validate and process one or more file uploads.

There is one class that can validate and process individual file uploads. It checks if the file name extension and MIME type is one of the allowed, as well if the file size is below the allowed size limit.

The class can create the destination directory if it does not exists and move the uploaded file to that directory.

Another class calls the first to validate and process multiple files being uploaded.
This recommendation solves the problem.
This recommendation does not solve the problem.

-1

Picture of MOUSTAFA ELGAMMAL by MOUSTAFA ELGAMMAL package author package author Reputation 215 - 9 years ago (2016-02-29) Comment

but not ajax

  • 6 Comments
  • 1. Picture of Dave Smith by Dave Smith - 9 years ago (2016-02-29) Reply

    While it is great to take pride in your own package, this one does not address the primary requirement that it be through ajax.

  • 2. Picture of MOUSTAFA ELGAMMAL by MOUSTAFA ELGAMMAL package author package author - 9 years ago (2016-02-29) in reply to comment 1 by Dave Smith Reply

    thanks about your opinion, but you are not the one who set the primary requirements.

  • 3. Picture of Manuel Lemos by Manuel Lemos - 9 years ago (2016-02-29) Reply

    Your class is fine for handling uploads, and it seems Marc wants a package that does that, as well does the browser side part using AJAX to submit the image without reloading the page.

  • 4. Picture of MOUSTAFA ELGAMMAL by MOUSTAFA ELGAMMAL package author package author - 9 years ago (2016-03-01) in reply to comment 3 by Manuel Lemos Reply

    ok, I understand now.

  • 5. Picture of Manuel Lemos by Manuel Lemos - 9 years ago (2016-03-01) in reply to comment 4 by MOUSTAFA ELGAMMAL Reply

    If you add the AJAX JavaScript code generation to your class so it can do the whole work, we can revert the vote and recommend your class too.

  • 6. Picture of Haseeb Ahmad Basil by Haseeb Ahmad Basil - 9 years ago (2016-03-09) Reply

    Not what is requested


PHP Upload Multiple Images Ajax: Process uploaded images sent via AJAX requests

This package can process uploaded images sent via AJAX requests.

It comes with jQuery plugin that can upload the one or more images using AJAX requests.

It can also display a preview of the selected images for upload, so the user can remove undesired images from the list of file to upload.

The PHP class can validate the uploaded images to check for valid image file name extensions, size limits, and limit number of uploaded files.
This recommendation solves the problem.
This recommendation does not solve the problem.

+6

Picture of Manuel Lemos by Manuel Lemos Reputation 26695 - 9 years ago (2016-02-28) Comment

This class is very good for that purpose. It uses a jQuery plugin that not only can take care of the image file upload via AJAX, but it also shows a preview of the image to be uploaded.

It also supports multiple file uploads in case you need them.


Recommend package
: 
: