jquery-file-upload

Getting the uploading file name before upload with jQuery File Upload plugin

感情迁移 提交于 2019-12-19 07:09:10
问题 I'm using the jQuery File Upload plugin https://github.com/blueimp/jQuery-File-Upload/wiki to upload multiple files to the server. I'll be using it with a custom web service which will store the uploaded images on the server. However, besides of the POST request body I'll also need to pass to the web service the name of the file which is being uploaded. So, with each file transfer I'll also need to pass to the web service the name of the file. Could anybody tell me how can I take the file

jQuery / AJAX - send additional data together with file upload

给你一囗甜甜゛ 提交于 2019-12-19 04:34:14
问题 I am uploading files to the server using jQuery: $.ajax({ url : 'http://www.example.com', dataType : 'json', cache : false, contentType : false, processData : false, data : formData, // formData is $('#file').prop('files')[0]; type : 'post', success : function(response) {something} }); I would like to send additional parameters together with the file. Is it possible? If yes - how? Thanks! 回答1: To send additional parameters, you can just append it to formdata like below: var formdata=new

Getting an empty ImmutableMultiDict object from jQuery request data

狂风中的少年 提交于 2019-12-19 04:17:28
问题 Trying to upload a file to server but the ImmutableMultiDict object is returning empty. upload.html <html> <head> <title>Upload File Ajax</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { $('#upload-file-btn').click(function() { var form_data = new FormData($('#upload-file')[0]); form_data.append('file', $('input[type=file]')[0].files[0]); console.log(form_data) $.ajax({ url: '

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

耗尽温柔 提交于 2019-12-18 09:10:10
问题 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

Best Ruby on Rails Architecture for Image Heavy App

醉酒当歌 提交于 2019-12-17 17:29:30
问题 I'm building an application that allows for large amounts of photo uploads at once, and wanted to know what the best setup would be to tackle this. This is what I am using so far: Jquery File Upload: allows users to drag and drop images CarrierWave: Processes images and resizes them with ImageMagick Amazon S3: CarrierWave uploads images to Amazon S3 through Fog Heroku: for hosting I'd like to allow users to be able to drag and drop a large amount of images onto a page, and then navigate to

Uploading multiple files asynchronously by blueimp jquery-fileupload

本秂侑毒 提交于 2019-12-17 09:57:47
问题 I'm using jQuery File Upload library (http://github.com/blueimp/jQuery-File-Upload), and I've been stuck figuring out how to use the library satisfying the following conditions. The page has multiple file input fields surrounded by a form tag. Users can attach multiple files to each input field All files are sent to a server when the button is clicked, not when files are attached to the input fields. Upload is done asynchronously Say the page has 3 input fields with their name attributes

Uploading multiple files asynchronously by blueimp jquery-fileupload

感情迁移 提交于 2019-12-17 09:56:40
问题 I'm using jQuery File Upload library (http://github.com/blueimp/jQuery-File-Upload), and I've been stuck figuring out how to use the library satisfying the following conditions. The page has multiple file input fields surrounded by a form tag. Users can attach multiple files to each input field All files are sent to a server when the button is clicked, not when files are attached to the input fields. Upload is done asynchronously Say the page has 3 input fields with their name attributes

How to upload multiple files using PHP, jQuery and AJAX

拥有回忆 提交于 2019-12-17 01:44:49
问题 I have designed a simple form which allows the user to upload files to the server. Initially the form contains one 'browse' button. If the user wants to upload multiple files, he needs to click on the "Add More Files" button which adds another 'browse' button in the form. When the form is submitted, the file upload process is handled in 'upload.php' file. It works perfectly fine for uploading multiple files. Now I need to submit the form by using jQuery's '.submit()' and send a ajax ['.ajax()

Django Drama: (Drag-n-Drop File Uploader in Multi-part Form) + (Bind File to Form / Model & Save to Postgres)

五迷三道 提交于 2019-12-14 04:21:47
问题 There are a few tiny related questions buried in here, but they really point to one big, hairy best practice question. This is kind of a tough feature to implement because it's supposed to do a couple tricky things at once... drag-and-drop multi-file uploader (via Javascript) multi-page form (page one: upload and associate files with an existing document model; page two: update and save file/document objects and meta-data to database) ...and I haven't found a pre-existing code sample or

Blueimp File Upload: Remove a file from file list before upload

孤街醉人 提交于 2019-12-14 03:43:43
问题 How can I remove a file from the selected files list in Blueimp plugins before submitting the form to upload. I tried this SO answer but its just remove file from UI not from queue. Here is my code $(function(){ $("#UploadPhotos").click(function(){ $("#ItemPhotos").click(); }); $('#ItemPhotos').fileupload({ url: "${pageContext.servletContext.contextPath}/XYZ", //dataType: 'json', autoUpload: false, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, maxFileSize: 5000000, // 5 MB // Enable image