में एकाधिक फ़ाइल अपलोड करें मुझे काम पर एकाधिक फ़ाइल अपलोड करने में कुछ समस्याएं आ रही हैं। जब मैं एक्स फाइलों का चयन करता हूं, तो यह सफलतापूर्वक हो जाता है, लेकिन पहली फ़ाइल को x बार अपलोड किया जा रहा है, और अन्य अपलोड नहीं किए जा रहे हैं। कोई भी यह इंगित करने में सक्षम है कि मैं क्या गलत कर रहा हूं?प्लेफ्रेमवर्क
प्रपत्र:
public static void uploadPictures(long id, String title, List<Blob> files) {
String error = "";
if(files != null && !title.trim().equals("")) {
Project project = Project.findById(id);
// Save uploaded files
Picture picture;
for(int i = 0; i<files.size(); i++) {
if(files.get(i) != null) {
System.out.println("i: "+i+"\nFiltype: "+files.get(i).type());
if(files.get(i).type().equals("image/jpeg") || files.get(i).type().equals("image/png")) {
picture = new Picture(project, title+"_bilde_"+(i+1), files.get(i));
project.addPicture(picture);
} else {
error += "Fil nummer "+(i+1)+" er av typen "+files.get(i).type()+" og ikke av typen .JPG eller .PNG og ble dermed ikke lagt til. \n";
}
} else {
error = "Ingen filer funnet";
}
}
} else {
error = "Velg en tittel for bildene";
}
if(error.equals("")) {
flash.success("Picture(s) added");
} else {
flash.error(error);
}
addPicture(id);
}
क्या आपने यह देखा: पी - http://stackoverflow.com/questions/7401364/multi-file-upload-with-play/7571000#7571000? – Rifat
क्या आप अपना उत्तर स्वीकार कर सकते हैं? धन्यवाद। –