File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.

Overview

jQuery File Upload

Contents

Description

File Upload widget with multiple file selection, drag&drop support, progress bars, validation and preview images, audio and video for jQuery.
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.

Demo

Demo File Upload

Features

  • Multiple file upload:
    Allows to select multiple files at once and upload them simultaneously.
  • Drag & Drop support:
    Allows to upload files by dragging them from your desktop or file manager and dropping them on your browser window.
  • Upload progress bar:
    Shows a progress bar indicating the upload progress for individual files and for all uploads combined.
  • Cancelable uploads:
    Individual file uploads can be canceled to stop the upload progress.
  • Resumable uploads:
    Aborted uploads can be resumed with browsers supporting the Blob API.
  • Chunked uploads:
    Large files can be uploaded in smaller chunks with browsers supporting the Blob API.
  • Client-side image resizing:
    Images can be automatically resized on client-side with browsers supporting the required JS APIs.
  • Preview images, audio and video:
    A preview of image, audio and video files can be displayed before uploading with browsers supporting the required APIs.
  • No browser plugins (e.g. Adobe Flash) required:
    The implementation is based on open standards like HTML5 and JavaScript and requires no additional browser plugins.
  • Graceful fallback for legacy browsers:
    Uploads files via XMLHttpRequests if supported and uses iframes as fallback for legacy browsers.
  • HTML file upload form fallback:
    Allows progressive enhancement by using a standard HTML file upload form as widget element.
  • Cross-site file uploads:
    Supports uploading files to a different domain with cross-site XMLHttpRequests or iframe redirects.
  • Multiple plugin instances:
    Allows to use multiple plugin instances on the same webpage.
  • Customizable and extensible:
    Provides an API to set individual options and define callback methods for various upload events.
  • Multipart and file contents stream uploads:
    Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload).
  • Compatible with any server-side application platform:
    Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.

Security

⚠️ Please read the VULNERABILITIES document for a list of fixed vulnerabilities

Please also read the SECURITY document for instructions on how to securely configure your Web server for file uploads.

Setup

jQuery File Upload can be installed via NPM:

npm install blueimp-file-upload

This allows you to include jquery.fileupload.js and its extensions via node_modules, e.g:

">
<script src="node_modules/blueimp-file-upload/js/jquery.fileupload.js">script>

The widget can then be initialized on a file upload form the following way:

$('#fileupload').fileupload();

For further information, please refer to the following guides:

Requirements

Mandatory requirements

Optional requirements

Cross-domain requirements

Cross-domain File Uploads using the Iframe Transport plugin require a redirect back to the origin server to retrieve the upload results. The example implementation makes use of result.html as a static redirect page for the origin server.

The repository also includes the jQuery XDomainRequest Transport plugin, which enables limited cross-domain AJAX requests in Microsoft Internet Explorer 8 and 9 (IE 10 supports cross-domain XHR requests).
The XDomainRequest object allows GET and POST requests only and doesn't support file uploads. It is used on the Demo to delete uploaded files from the cross-domain demo file upload service.

Browsers

Desktop browsers

The File Upload plugin is regularly tested with the latest browser versions and supports the following minimal versions:

  • Google Chrome
  • Apple Safari 4.0+
  • Mozilla Firefox 3.0+
  • Opera 11.0+
  • Microsoft Internet Explorer 6.0+

Mobile browsers

The File Upload plugin has been tested with and supports the following mobile browsers:

  • Apple Safari on iOS 6.0+
  • Google Chrome on iOS 6.0+
  • Google Chrome on Android 4.0+
  • Default Browser on Android 2.3+
  • Opera Mobile 12.0+

Extended browser support information

For a detailed overview of the features supported by each browser version and known operating system / browser bugs, please have a look at the Extended browser support information.

Testing

The project comes with three sets of tests:

  1. Code linting using ESLint.
  2. Unit tests using Mocha.
  3. End-to-end tests using blueimp/wdio.

To run the tests, follow these steps:

  1. Start Docker.
  2. Install development dependencies:
    npm install
  3. Run the tests:
    npm test

Support

This project is actively maintained, but there is no official support channel.
If you have a question that another developer might help you with, please post to Stack Overflow and tag your question with blueimp jquery file upload.

License

Released under the MIT license.

Comments
  • Error: SyntaxError: Unexpected token <

    Error: SyntaxError: Unexpected token <

    Hi im trying to upload images files but everytime i push upload

    i get this - Error: SyntaxError: Unexpected token <

    pleas help and thx for any help.

    opened by Dacarts 56
  • Upload multiple files directly to S3?

    Upload multiple files directly to S3?

    I have been using Jquery-file-upload plugin with paperclip and S3 for quite a while now and I really like it. However, as the files I need to upload become bigger, uploading directly to S3 becomes my only choice.

    This article demonstrates how to upload a single file to S3, unfortunately it doesn't do multiple files uploading.
    https://github.com/blueimp/jQuery-File-Upload/wiki/Upload-directly-to-S3

    so my question is, is it possible to iterate through a list of files and create a single post form for each file on the fly?

    Or is it possible to create an independent form and then repopulate the field in each iteration?

    Any tips are greatly appreciated.

    opened by Kickyourassforever 50
  • Retain EXIF and ICC headers with client-side image processing

    Retain EXIF and ICC headers with client-side image processing

    It seems like it should be possible to retain the ICC and EXIF data by extracting the APP2 segment data from the original image and re-attach it to the resized image.

    ICC Color Profiles? For those unfamiliar, let me explain: Perhaps you have heard of sRGB, RGB, CMYK, etc. These are color mappings that instruct devices how to render the colors. When this data is stripped from the image, the colors get all fucked up. Eg. CMYK image is upload, profile is stripped, server displays image, browser reads is as untagged RGB, displays in sRGB color space, resulting wrong colors. Blues shift to purple, grey to black, etc.

    Normally the best way to manage mismatched color spaces is through conversion with Image Magick (reading the source profile and then converting to sRGB, which is a standardized color profile for computer monitors).

    However, once the image has the ICC profile stripped with Canvas resize, the conversion cannot be peformed in Image magick because the original color space is unknown.

    I've seen a solution for this (Grabbing the ICC info from the JPG header and reinserting it) in pupload: https://github.com/moxiecode/plupload/blob/master/src/javascript/plupload.html5.js

    However, I have been unsuccessful thus far in integrating it.

    feature 
    opened by edeis 38
  • All works but

    All works but "Empty file upload result" error appears

    I'm using basic example and keep getting "Empty file upload result" error although all files are uploading correctly. I checked permissions for "files" and "thumbnails" folders - it's okay too (I tried 775 and 777). Can somebody help me?

    opened by michellekg 36
  • Problems with iframe upload

    Problems with iframe upload

    So I had the uploader setup and working just fine, or so I thought ... turns out it didn't work in IE because it (in all its iterations) does not support AJAX uploads. So I've been trying to get it to work with the options 'forceIframeTransport' set to true.

    I have the basic plugin included, the iframe-transport file too ... and I have the upload script on the server returning text/html as advised in the documentation. I have it working ... almost ... all the variables are getting sent to the server properly except the actual file and I can't figure out why.

    At first I thought it was just an IE thing, but with the 'forceIframeTransport' option set to true, google Chrome is doing the same thing.

    I 'm worried that I might not fully understand what 'The Iframe Transport requires a file input selection to upload files.' means. I have a file input, which I'm using to add file info to the UI for each file selection ... is there something I'm missing?

    opened by concept47 33
  • Problem with new codeigniter example

    Problem with new codeigniter example

    Hello, I tried to setup codeigniter with new example, but I keep getting error when I click "Start Upload": Unable to load the requested file: upload.php

    Images are uploaded in the uploads file, but the error is there (setup I made is the same as one in the example). Also, at the end of example author put following line: I had a problem with seeing images/thumbnails initially then I realized I had not set uploads/ directory in my .htacces file

    I am new to .htacces, so I don't know how to do this part. Can someone help me?

    opened by Brav 31
  • Plugin does not initialize with Version 5.0

    Plugin does not initialize with Version 5.0

    When I'm trying to initialize the plugin on the file upload control

    if('undefined' !== $.type($('input[type=file][name=userfile]')[0])) {
        var file_input = $('input[type=file][name=userfile]');
    
        file_input.fileUploadUI({
            uploadTable: $('#files'),
            buildUploadRow: function (files, index, handler) {
                return $('<tr><td>' + files[index].name + '<\/td>' +
                        '<td class="file_upload_progress"><div><\/div><\/td>' +
                        '<td class="file_upload_cancel">' +
                        '<button class="ui-state-default ui-corner-all" title="Cancel">' +
                        '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
                        '<\/button><\/td><\/tr>');
            },
        });
    }
    

    it says: file_input.fileUploadUI is not a function

    All the dependencies are present, either css or js files, Firebug shows them loaded and ready to run.

    Some info: I'm using it in SugarCRM environment, so I've added the links to the files into the head part of the page, where the scripts and styles normally should be. The idea was to apply and initialize it to file upload control programmatically only in the case, when this control is present in the form. I don't want to apply this plugin to the whole form because this form is a part of Wizard step and any intervention into the form's normal functionality will destroy the wizard logic. The only task, the plugin can do for me is form-independent upload of the imported file before the user goes to the next Wizard step.

    Also, the Steps load themselves via AJAX ($('#content_td').html(xhr.responseText)), so there is no place for $(function) like in the examples, because it requires the page to be reloaded to initialize it.

    If it is not a bug and I'm doing anything wrong, please help me to figure out what it exactly is. Thank you.

    opened by gadeshi 30
  • IE 8 problem

    IE 8 problem

    Itry the new code on firefox and all go well, but if i try to upload a file on ie 8 a pop up show out asking me to download upload.php file. Anyone know why?

    opened by Manolo2 30
  • Error: [object Error]  in Internet Explorer

    Error: [object Error] in Internet Explorer

    Great project, thank you!

    However, I'm trying to implement the uploader. It works perfectly in FF, Chrome and Safari, but IE7, 8, 9 all fail to load the JSON response correctly.

    My server-side uploader is correctly making the images on the server, but IE only returns Error: [object Error] highlighted in red, rather than the JSON return of thumbnail, url etc.

    Are there any tips or guidance you can supply on trying to resolve or debug this IE only issue?

    opened by carlospictor 28
  • IE9 Cross domain upload issue

    IE9 Cross domain upload issue

    Hi, while trying to upload to distance server, im getting this error:

    SCRIPT5: Access is denied. jquery.js, line 3241 character 6

    When i comment iframe_transport.js and include xdr-transport.js i stop getting the error and the post request send but the file isnt (empty $_FILE on server) and i get this error: No conversion from text to iframe

    Any ideas? Thanks.

    opened by orenyakobi 27
  • iOS + EXIF Orientation Broken

    iOS + EXIF Orientation Broken

    This was an issue previously but was fixed but it appears it's back but with strange symptoms.

    The scenario:

    • Open the demo website in iOS 6 device (I am on latest version of 6)
    • Upload a photo taken on the device
    • Preview and final upload result have correct orientation on iOS in safari and used as img src: Image gallery - http://c.sampotts.me/RSlx Safari - http://c.sampotts.me/RTA6
    • View it directly in a browser, no problems: http://c.sampotts.me/RSK1
    • The problems start when you then use within a web page (img src): Chrome - http://c.sampotts.me/RSau Safari - http://c.sampotts.me/RT8z Firefox - http://c.sampotts.me/RSX1

    It seems all orientations on iOS result in strange output.

    Obviously this boils down to the EXIF orientation as regular portrait and landscape images taken with a DSLR are not an issue. I've not looked into it but I believe there are 8 possible EXIF orientation values, perhaps it's possible to reset the correct value. I'll look into it further and report back.

    opened by ghost 26
  • $.type is deprecated

    $.type is deprecated

    Using $.type is deprecated according to the jQuery Migration 3.3.2 tool.

    See: https://github.com/jquery/jquery-migrate/blob/main/warnings.md#jqmigrate-jquerytype-is-deprecated

    Cause: This method returns a string that indicates the type of the argument, for example "number" or "function". However, as the JavaScript language evolves this method has become problematic because new language constructs might require this function to either return a new string (potentially breaking existing code) or somehow map new constructs into existing strings (again, potentially breaking existing code). Examples of new recent JavaScript features include asynchronous functions, class constructors, Symbols, or functions that act as iterators.

    Solution: Review code that uses jQuery.type() and use a type check that is appropriate for the situation. For example. if the code expects a plain function, check for typeof arg === "function".

    opened by melloware 2
  • Client side resize bad aliasing depending on browser

    Client side resize bad aliasing depending on browser

    Hello,

    This is not so much a "bug" as trying to learn about something we observe and maybe understanding if there can be improvements.

    We use client side resize in jquery upload to resize images to around 1200x825px height.

    We've noticed that Firefox and Chrome have noticeably different image quality after resize, but both leave much more aliasing in angled lines than server side Imagick does with its default filters (Lanczos or Mitchell).

    Is this something that can be improved somehow? Are some browsers better than others with client side resize, and what are they?

    I took an image and uploaded with client side resize off, then with it "on" in Chrome and Firefox, and I cropped out a section from each sample to demonstrate the most obvious artifacts:

    example_resize_jqueryupload

    The angled line is the most obvious, but even if you look at the "psb speakers" logo you can clearly see the Imagic resize is cleaner than the other two, especially compared to Firefox which has the worst resize.

    Is there any way to set the client side resize to use better or different resize algorithms?

    feature 
    opened by redemption 2
  • Deprecated function usage in jquery-ui

    Deprecated function usage in jquery-ui

    There's been some work towards removing deprecated function usage over the last few months. It seems the below haven't been pointed out before, so here goes:

    jQuery.isArray is deprecated; use Array.isArray

    • https://github.com/blueimp/jQuery-File-Upload/blob/f5d629abdaf480fefad8ad823cb1e2c96805bd4e/js/jquery.fileupload-ui.js#L86

    jQuery. isFunction() is deprecated. In most cases, its use can be replaced by typeof x === "function"

    • https://github.com/blueimp/jQuery-File-Upload/blob/d2535157e6005eb3c37f7d0b0042462393139c5b/js/vendor/jquery.ui.widget.js#L134
    • https://github.com/blueimp/jQuery-File-Upload/blob/d2535157e6005eb3c37f7d0b0042462393139c5b/js/vendor/jquery.ui.widget.js#L276
    opened by bytestream 16
  • Callback after bulk delete

    Callback after bulk delete

    Bulk delete implementation simply looks up delete buttons of selected items in file list and triggers click on them.

    https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload-ui.js#L638

    Would be great if the delete requests get tracked and an event gets fired after bulk deletion completes.

    Usecase is reloading of some parts of the page after bulk delete.

    feature 
    opened by rnixx 1
  • Colors are changed when using Client-Side image resize

    Colors are changed when using Client-Side image resize

    Hello,

    When I'm uploading the attached photo and resizing the image using the 'imageMaxWidth' and 'imageMaxHeight' options, the image's colors are changed.

    When I'm not using the above options or set them to 'Number.MAX_SAFE_INTEGER', the colors are the same as the original image.

    Here is the original image: 20_Nis_Rogue_Sport-039-source

    Here is the result after uploaded to your demo site (which using 'imageMaxWidth' and 'imageMaxHeight'):

    bug 
    opened by cb-eli 1
Owner
Sebastian Tschan
🍌banana banana banana
Sebastian Tschan
Pomf is a simple lightweight file host with support for drop, paste, click and API uploading.

Pomf Pomf is a simple file uploading and sharing platform. Features One click uploading, no registration required A minimal, modern web interface Drag

Pomf 772 Jan 8, 2023
FIle Uploader is a php package to aid fast , easy and safe file upload

FILE UPLOADER FIle Uploader is a php package to aid fast , easy and safe file upload installation composer require codad5/file-helper Features Fast an

Aniezeofor Chibueze Michael 2 Sep 3, 2022
A python program to cut longer MP3 files (i.e. recordings of several songs) into the individual tracks.

I'm writing a python script to cut longer MP3 files (i.e. recordings of several songs) into the individual tracks called ReCut. So far there are two

Dönerspiess 1 Oct 27, 2021
Upload File Library For PHP ( Simple & Easy User )

Upload File Library For Backend/ServerSide PHP ( Simple & Easy For Use ), Support Multiple Upload

Lamhot Simamora 1 Oct 12, 2021
ORM-based file upload package for php.

#Stapler Note: If you've previously been using this package, then you've been using it with Laravel. This package is no longer directly coupled to the

Code Sleeve 541 Dec 30, 2022
Basic anonymous and registered upload storage for temporary share file self hosted.

TMPShareX Basic anonymous and registered upload storage for temporary share file self hosted. Server Requirement PHP 7.4.8 [Support PHP 8] Nginx 1.19.

Sandy Hermansyah 1 Feb 3, 2022
PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself.

PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself.

Haschek Solutions 709 Jan 3, 2023
This package used to upload files using laravel-media-library before saving model.

Laravel Media Uploader This package used to upload files using laravel-media-library before saving model. In this package all uploaded media will be p

Ahmed Fathy 312 Dec 12, 2022
This project is a demo for Media-Upload package:

??️ Media-Upload-Demo This project is a demo for Media-Upload package: ?? Installation guide As always you need to: composer install Then npm install

Mohamed Hafidi 9 Jan 9, 2023
Private file storage and share with user build with laravel and vue inspired by google drive

LaravelDrive is a file storage system that allows store private file and share with users build wiht laravel and vue inspired by google drive. Laravel

Shahadat Hossain 70 Dec 22, 2022
Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.

Documents ・ Installation ・ Integration ・ Config ・ Customization ・ Events ・ Upgrade ・ Demo ・ FAQ Features File upload and management Uploading validati

UniSharp 1.9k Jan 1, 2023
A lightweight file manager with full ShareX, Screencloud support and more

XBackBone is a simple, self-hosted, lightweight PHP file manager that support the instant sharing tool ShareX and *NIX systems. It supports uploading

Sergio Brighenti 751 Jan 8, 2023
Flysystem adapter for Google Cloud Storage

Flysystem adapter for Google Cloud Storage This package contains a Google Cloud Storage driver for Flysystem. Notice This package is a fork from super

Spatie 21 May 1, 2022
Friendica is a decentralised communications platform that integrates social communication

Friendica is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services.

Friendica 1.2k Jan 6, 2023
A php sharex uploader with discord embed function/twitter card support

Sharex Uploader Simple Sharex Uploader with Discord embed function Download replace your data and upload to your sevrer

Clynt 4 Jan 9, 2022
☁️ Nextcloud server, a safe home for all your data

Nextcloud Server ☁ A safe home for all your data. Why is this so awesome? ?? ?? Access your Data You can store your files, contacts, calendars and mor

Nextcloud 21.1k Dec 31, 2022
Watch changes in the file system using PHP

Watch changes in the file system using PHP This package allows you to react to all kinds of changes in the file system. Here's how you can run code wh

Spatie 170 Dec 25, 2022
File manager module for the Lumen PHP framework.

Lumen File Manager File manager module for the Lumen PHP framework. Please note that this module is still under active development. NOTE: Branch 5.1 i

Digia 40 Aug 20, 2022