jquery-file-upload

Why doesn't Blueimp's jQuery-File-Upload plugin fire callbacks?

被刻印的时光 ゝ 提交于 2019-11-30 00:25:43
I'm experimenting with Blueimp's jQuery-File-Upload plugin, which judging by the demo looks very promising. It's really easy to implement: var $uploadButton = $("#fileop-upload");// <input type="file" id="fileop-upload" [etc] /> $uploadButton.fileupload({ url : "//domain/path/to/receive-uploaded-files" }); The selected files are uploaded fine without refreshing the page as expected, but of course with a minimal configuration like this the user won't get any notification. Here's where the plugin's callbacks would come in handy. According to the documentation there are two ways to define

How to resize images client side using jquery file upload

一曲冷凌霜 提交于 2019-11-30 00:22:10
问题 I am using blueimp jquery-file-upload in a Rails 3.2 app, via the jquery-fileupload-rails gem. I am trying to resize images on the client side prior to uploading, but am having trouble following the documentation. My code is below. Currently uploading works perfectly, but the images are not resized. What is the correct syntax to resize images via jquery-file-upload. (Two approaches shown in the coffeescript based on this and this documentation. Neither works for me.) #Coffeescript jQuery ->

How to make JQuery file upload plugin call backend only once for all the files in an upload?

谁说胖子不能爱 提交于 2019-11-29 16:09:16
I'm using sails.js to build a website. I have a model named timeline . It has some text fields along with a collection named pictures . Each timeline can have multiple pictures . I want to update all these fields at once when user clicks save . I'm using JQuery file uploader to help multifile upload. Problem is, JQuery file upload calls my backend file-uploader service once for each picture uploaded. I need to update the other text fields only once and they need to be updated before the pictures records get created since each picture needs to have a timeline ID associated with them. Is async

Vaadin with JQuery FileUpload

左心房为你撑大大i 提交于 2019-11-29 12:41:16
I would like to create FileUploader with Vaadin . But I need to get more features over normal Vaadin Upload . beautiful and easy to manage (but optional) fast and never failed while uploading include progress bar show preview multi file upload support upload file size and type restriction drag and drop client-side image resizable (it is main feature for me because all of my uploaded files were images) There has an addon MultiFileUpload . Yes , it is perfect for most of my requirements but not for client-size image resizing . So I decided to use JQuery FileUpload because it is support for

Implementation of fully functional media uploading in web application

末鹿安然 提交于 2019-11-29 08:49:44
Suppose we have the web application which handle create, read, update and delete articles and each article should have gallery of images. I have to make one to one relation between Article and Gallery and one to many relation between Gallery and Media. HTML5 gives a lot of features like multiupload, so I want to use this excellent http://blueimp.github.io/jQuery-File-Upload/ plugin for that. The problem is how to handle the file upload "in memory" like other form's data? For example when we show the page for create new article we should be able to fill in article's data fields and select

Regular expression for excluding file types .exe and .js

允我心安 提交于 2019-11-29 06:48:10
I am using JQuery File upload plugin, for giving value to the option accept files I need the regular expression which will tells what are the file types to be restricted. I need to restrict both exe and js which i achieved by using below expression (\.|\/)(!exe|!js)$ But this is expression was not allowing other files as well then I tried adding one extension as below (\.|\/)(!exe|!js|pdf)$ With Above regular expression it is accepting only pdf and not accepting exe and JS. Now I need to enable for all file extentions except exe and js. It will be difficult to add all the extensions to the

jQuery fileupload - get list of uploaded files

℡╲_俬逩灬. 提交于 2019-11-28 21:41:46
I'm using the very good jquery plugin blueimp / jQuery-File-Upload $('#fileupload').fileupload({ autoUpload: true , filesContainer: '#attachments_presentation tbody' , stop: function (e) { console.log(data); } }); And I'm not able to do something very simple: get the list of uploaded files (with their name on the server) Firstly I naively though it would be stored on the file input so I could get the list with $('#fileupload').val(); But it's not, so I though about something like $('#fileupload').fileupload('getfiles'); I can't find the way from the docs Can somebody tell me how I can get the

Jquery file upload plugin: how to validate files on add?

时间秒杀一切 提交于 2019-11-28 18:54:54
$('#fileupload') .fileupload({ acceptFileTypes: /(\.|\/)(jpg)$/i }) .on('fileuploadadd', function (e, data) { console.log(data.files.valid); //undefined setTimeout(function () { console.log(data.files.valid); //true or false }, 500); }) ; jsFiddle How to get boolean value of property data.files.valid without timeout ? Here is what you want to do: $('#fileupload') .fileupload({ acceptFileTypes: /(\.|\/)(jpg)$/i }) .bind('fileuploadadded', function (e, data) { console.log(data.files.valid); }); The core jquery.fileupload.js file is adding your files and triggering the "fileuploadadd" event, but

jQuery File Upload preview image

空扰寡人 提交于 2019-11-28 18:01:11
I am using jQuery File Upload plugin ( http://blueimp.github.io/jQuery-File-Upload/ ) for image upload for my website. I have look through ( https://github.com/blueimp/jQuery-File-Upload/wiki/Options ), but I didn't find the setting to assign an element to display the image. So, how can I preview the image on the webpage with this plugin? Thank you. I don't think that the Jquery File Upload plugin provides preview functionality. But you can easily implement it into the plugin's add option: add: function (e, data) { if (data.files && data.files[0]) { var reader = new FileReader(); reader.onload

Show a progress on multiple file upload Jquery/Ajax

我的未来我决定 提交于 2019-11-28 16:00:44
I have upload form that allows users to upload multiple files. I decided that a progress bar would be good if the files are quite large. Below is my source code. I am new to jquery normally I would just php but I find that ajax is more user friendly. <div id="new_upload"> <div class="close_btn"></div> <div id="uploads"></div> <form action="global.func/file_upload.php" method="post" enctype="multipart/form-data" id="upload_file"> <fieldset><legend>Upload an image or video</legend> <input type="file" id="file" name="file[]" placeholder="Upload Image or Video" multiple /><input type="submit"