// Upload function for dropped contact photos files. Should go in the Contacts class/object.
$.fileUpload=function(files){
varfile=files[0];
if(file.size>$('#max_upload').val()){
OC.dialogs.alert(t('contacts','The file you are trying to upload exceed the maximum size for file uploads on this server.'),t('contacts','Upload too large'));
return;
}
if(file.type.indexOf("image")!=0){
OC.dialogs.alert(t('contacts','Only image files can be used as profile picture.'),t('contacts','Wrong file type'));
return;
}
varxhr=newXMLHttpRequest();
$(function(){
// Upload function for dropped contact photos files. Should go in the Contacts class/object.
$.fileUpload=function(files){
varfile=files[0];
if(file.size>$('#max_upload').val()){
OC.dialogs.alert(t('contacts','The file you are trying to upload exceed the maximum size for file uploads on this server.'),t('contacts','Upload too large'));
return;
}
if(file.type.indexOf("image")!=0){
OC.dialogs.alert(t('contacts','Only image files can be used as profile picture.'),t('contacts','Wrong file type'));
return;
}
varxhr=newXMLHttpRequest();
if(!xhr.upload){
OC.dialogs.alert(t('contacts','Your browser doesn\'t support AJAX upload. Please click on the profile picture to select a photo to upload.'),t('contacts','Error'))
OC.dialogs.alert(t('contacts','Your browser doesn\'t support AJAX upload. Please click on the profile picture to select a photo to upload.'),t('contacts','Error'))