Hi,

When you choose some files to upload, don't click on the "Upload" button, and save your node, files are not uploaded, like the core file widget.

So I have created this little Javascript snippet to display an alert to the user when there are files waiting for upload :

//Compter le nombre de tr dans la liste des photos à uploader. Si < 1, on affiche un message pour dire qu'il y a des photos non uploadées
					jQuery('#edit-submit').click(function(){
						if('#edit-field-photos-und-plup-filelist'){
							var rowCount = jQuery('#edit-field-photos-und-plup-filelist > table > tbody > tr').length;								
							if(rowCount > 1) {
								alert('Becareful, you have some files waiting for upload !');
								return false;
							}
						}
					});

Joel

Comments

akk’s picture

Could you add some more info please? which file this snippet supposed to be added to do the check? thank you in advance.

joelrotelli’s picture

You can add this snippet in a custom JS file (just declare it in your .info file)

Sinan Erdem’s picture

Hello and thanks for the code snippet.

I suppose it will be better if we automatically upload the images when the user saves the node. Normal Drupal imagefield widget works like that.

There is also a module for this purpose: https://drupal.org/project/autoupload Maybe integration is possible.