Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sequential options on bundle #62

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.DS_Store

.project
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
PunkAveFileUploaderBundle
=========================

Introduction

Introduction
============

This bundle provides multiple file uploads, based on the [BlueImp jQuery file uploader](https://github.com/blueimp/jQuery-File-Upload/) package. Both drag and drop and multiple file selection are fully supported in compatible browsers. We chose BlueImp because it has excellent backwards and forwards browser compatibility.
Expand Down Expand Up @@ -329,6 +330,18 @@ You'll probably want to add an error handler for this case. In the template wher
}
});
});

Use sequential uploads
--------------------------------

You can use the sequentialUpload options by adding this line on your JS call

$(function() {
new PunkAveFileUploader({
// ... other required options,
'sequentialUploads': true
});
});

Limitations
===========
Expand All @@ -337,9 +350,12 @@ This bundle accesses the file system via the `glob()` function. It won't work ou

Syncing files back and forth to follow the editId pattern might not be agreeable if your attachments are very large. In that case, don't use the editId pattern. One alternative is to create objects immediately in the database and not show them in the list view until you mark them live. This way your edit action can use the permanent id of the object as part of the `folder` option, and nothing has to be synced. In this scenario you should probably move the attachments list below the form to hint to the user that there is no such thing as "cancelling" those actions.


Notes
=====

The uploader has been styled using Bootstrap conventions. If you have Bootstrap in your project, the uploader should look reasonably pretty out of the box.

The "Choose Files" button allows multiple select as well as drag and drop.


1 change: 1 addition & 0 deletions Resources/public/js/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function PunkAveFileUploader(options)
dataType: 'json',
url: uploadUrl,
dropZone: $el.find('[data-dropzone="1"]'),
sequentialUploads: (options.sequentialUploads),
done: function (e, data) {
if (data)
{
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "symfony-bundle",
"description": "Multiple file uploads for Symfony2 with the BlueImp uploader. Also scales uploaded images",
"keywords": ["upload", "file", "multiple file upload", "uploader", "blueimp", "symfony", "symfony bundle", "bundle", "punkave", "image transform", "symfony-2.0", "symfony-2.1"],
"homepage": "https://github.com/punkave/symfony2-file-uploader-bundle",
"homepage": "https://github.com/brossdu/symfony2-file-uploader-bundle",
"license": "MIT",
"authors": [
{
Expand All @@ -13,7 +13,12 @@
{
"name": "Wes John-Alder",
"email": "wes@punkave.com"
},
{
"name": "Pierre Brossard",
"email": "brossard.p@gmail.com"
}

],
"require": {
"php": ">=5.3.2",
Expand Down