Comments (3)
I need to implement the feature. I will let you know once it is done.
from jquery-upload-file.
Please see.
I've implemented so.
but, Not perfect.
There is a part that was custom to match my file.
function serializeAndUploadFiles(s, obj, files) {
var i = 0;
s.onSuccess = function (files, data, xhr) {
// success event callback
/* MY custom Source std */
//insert image.
jQuery('#sortable').append(data);
/* MY custom Source end*/
return loop();
};
function loop(){
if(i<files.length){
body();
}
i++;
}
function body(){
if (!isFileTypeAllowed(obj, s, files[i].name)) {
if (s.showError) alert(s.extErrorStr + s.allowedTypes);
//$("<div style='color:red;'><b>" + files[i].name + "</b> " + s.extErrorStr + s.allowedTypes + "</div>").appendTo(obj.errorLog);
return false;
//continue;
}
if (s.maxFileSize != -1 && files[i].size > s.maxFileSize) {
if (s.showError) alert(s.sizeErrorStr + 'once file '+getSizeStr(s.maxFileSize)+' not over');
return false;
//$("<div style='color:red;'><b>" + files[i].name + "</b> " + s.sizeErrorStr + getSizeStr(s.maxFileSize) + "</div>").appendTo(obj.errorLog);
//continue;
}
var ts = s;
var fd = new FormData();
var fileName = s.fileName.replace("[]", "");
fd.append(fileName, files[i]);
fd.append('module','editor');
fd.append('act','procEditorCall');
fd.append('component',init('component'));
fd.append('method','insertImage');
fd.append('editor_sequence',init('editor_sequence'));
var extraData = s.formData;
if (extraData) {
var sData = serializeData(extraData);
for (var j = 0; j < sData.length; j++) {
if (sData[j]) {
fd.append(sData[j][0], sData[j][1]);
}
}
}
ts.fileData = fd;
var pd = new createProgressDiv(obj, s);
var fileNameStr="";
if(s.showFileCounter)
fileNameStr = obj.fileCounter + s.fileCounterStyle + files[i].name
else
fileNameStr = files[i].name;
pd.filename.html(fileNameStr);
var form = $("<form style='display:block; position:absolute;left: 150px;' class='" + obj.formGroup + "' method='" + s.method + "' action='" + s.url + "' enctype='" + s.enctype + "'></form>");
form.appendTo('body');
var fileArray = [];
fileArray.push(files[i].name);
ajaxFormSubmit(form, ts, pd, fileArray, obj);
obj.fileCounter++;
}
return loop();
}
from jquery-upload-file.
Thanks i will add the feature to plugin
from jquery-upload-file.
Related Issues (20)
- Chrome 70 HOT 1
- When onSubmit returns false, you cannot upload anymore file HOT 1
- using javascript to upload Files
- createProgress function is not available immediately in onLoad callback param obj HOT 1
- Can't submit form without upload file?
- Delete callback not passing filename
- I find one file is not uploaded correctly in ajax request HOT 1
- Form Input elements Id
- JQuey-upload-file update formData is not working HOT 1
- How to check add user files or not?
- malsup.github.io/jquery.form.js is not available
- getResponses() returned data HOT 1
- using formData to send "action" for wordpress ajax calls HOT 1
- https://rawgithub.com/hayageek/jquery-upload-file/master/css/uploadfile.css 404
- How to increase drag and drop div height?
- "allowDuplicates: false" not working after page reload with "onLoad:function" enabled HOT 1
- DOM-XSS via document name
- Path traversal vulnerability in delete.php
- Can I obtain the file dimensions?
- the
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-upload-file.