<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script> <script src="/uploadify/swfobject.js" type="text/javascript"></script> <script src="/uploadify/jquery.uploadify.min.js" type="text/javascript"></script> <script type="text/javascript"> Array.prototype.inArray = function(p_val) { var l = this.length; for(var i = 0; i < l; i++) { if(this[i] == p_val) { return true; } } return false; } $(document).ready(function(){ $('#loader').hide(); }); $(function() { $('#file_upload').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.php', 'cancelImg' : '/uploadify/cancel.png', 'removeCompleted' : false, 'width' : 250, 'buttonImg' : '/images/up-bouton/fr.jpg', 'simUploadLimit' : 1, 'buttonText': 'Choisissez un fichier', 'queueID' : 'queue2', 'onError' : function (event,ID,fileObj,errorObj) { alert(errorObj.type + ' Error: ' + errorObj.info); }, 'onComplete' : function(event, ID, fileObj, response, data) { if (response) { var input = response.substring(1 + response.lastIndexOf("/")); if (input == '' || input == 'undefined') { alert ("There was a problem during the upload"); window.location.href ='/'; } $("#leconvertisseur").append(""); } else { alert ("There was a problem during the upload"); window.location.href ='/'; } }, 'onAllComplete' : function(event,data) { $('#queue2').hide(); $('#loader').show(); var nom = $("#nom").attr("value"); var catego = $("#categorie").attr("value"); var choixform = $('#choix_format option:selected').attr("value"); $.ajax({ type: "GET", url: "/ini-fin.php", cache: false, data: { nom: nom, categorie: catego, choix_format: choixform } }).done(function( msg ) { // dont return anything }); var newnamearr = new Array(); newnamearr = nom.split('.'); var specialext = new Array('pdf', 'gif', 'psd', 'doc', 'docx', 'rtf', 'odt', 'ott', 'bib', 'pdb', 'psw', 'latex', 'sdw', 'stw', 'sxw', 'txt', 'vor', 'csv', 'dbf', 'dif', 'ods', 'pts', 'pxl', 'sdc', 'slk', 'stc', 'sxc', 'vor', 'xls', 'xlsx', 'xlt', 'ppt', 'pptx', 'odp'); if (specialext.inArray(newnamearr[1])) { newname = newnamearr[0] + ".zip"; } else { newname = newnamearr[0] + "." + choixform; } var essais = 0; var pollForResults = self.setInterval(function() { $.get("inf.php", { nom: newname, essai: essais, origine: nom }, function(data) { if (data.reader == "go") { window.location.href = "/converted.php?nom=" + newname; clearInterval(pollForResults); } else if (data.reader == "error") { clearInterval(pollForResults); alert("There was a problem during the conversion, please retry or inform us"); window.location.href = "/"; } else { essais = data.ess; } }, "json"); },2000); } }); }); </script>
1 |
|
2 |
Convertir en |
Contactez nous
agence web
Copyright © 2013
Si vous trouvez ce site utile